1.(中文版资料中)docker-compose.yml 格式问题
参考示例运行 docker stack deploy -c docker-compose.yml getstartedlab
报错 yaml: line 1: mapping values are not allowed in this context
原因:中文资料有点坑,yml文件语法有问题,冒号之后没有空格。但是英文的就没问题,是不是copy的时候没有注意。
解决:冒号之后加空格,语法就正确,运行就成功了。
2.docker login的问题
Username: yanshinian
Password:
Error saving credentials: error storing credentials - err: exit status 1, out: `The user name or passphrase you entered is not correct.`
解决办法:rm /usr/local/bin/docker-credential-osxkeychain
之后
yanshiniandeMBP:~ yanshinian$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to to create one.
Username: yanshinian
Password:
Login Succeeded
bogon:openresty-1.13.6.1 yanshinian$ docker run learn/tutorial ping
docker: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown.
ERRO[0000] error waiting for container: context canceled
解决方法:docker run learn/tutorial /bin/sh -C && ping