先看报错
[root@izm5e1p54z admin]# docker-compose -f docker-compose.yml up -d
Creating network "admin_dbbased" with the default driver
Creating nginx ... error
Creating mysqldb ...
Creating redis ...
Creating mysqldb ... error
ERROR: for nginx Cannot create container for service nginx: No command specified
Creating redis ... error
ERROR: for redis Cannot start service redis: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"redis-server\": executable file not found in $PATH": unknown
ERROR: for nginx Cannot create container for service nginx: No command specified
ERROR: for mysql Cannot start service mysql: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"--default-time-zone=+8:00\": executable file not found in $PATH": unknown
ERROR: for redis Cannot start service redis: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"redis-server\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project.
导致原因
在导入镜像时使用的是docker import
导入的镜像
[root@izm5e1p54z docker_images]# docker import nginx.tar
sha256:685d4e44bda87a9515fb276acfc2e4746619d5e15e7
[root@cdocker_images]# docker import redis.tar
[root@izm5e1p54z docker_images]# docker tag 685d4e44bda8 nginx:latest
[root@izm5e1p54z docker_images]# docker tag 2bf1aee6f8dd redis:latest
简单分析
docker save
是和docker load
配合使用的
docker import
是和 export
配合使用的