hi every body . i try to run Persist the data Lab in " https://docs.docker.com/get-started/part5/#persist-the-data " but when i run docker stack deploy -c docker-compose.yml getstartedlab with new yaml file in docker-machine myvm1 as a manager shows this message :
[root@bah-devops new-test]# docker-machine ssh myvm1 "docker stack deploy -c docker-compose-WITH-REDIS.yaml getstartedlab "
yaml: line 5: mapping values are not allowed in this context
exit status 1
[root@bah-devops new-test]#
That particular class of error is typically a syntax error in the YAML. Since you didn’t provide a copy of your YAML, we can only guess at the issue. It can be as simple as a missing space character or “:”, the use of tabs instead of spaces, or a misaligned block.
In the section you referenced, here are the first 5 lines
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: username/repo:tag
If you have copied that file literally, the line with “image:” and everything before, are the place to look for items I’ve mentioned above, as well as missing quotation marks, colons, and incorrect whitespace.
With the whitespace stripped it’s hard to rule out that you’re simply missing spaces. I have no idea how to post valid YAML here, I used pastebin earlier. You should check out a YAML validator, such as http://www.yamllint.com/ .