Docker什么也没做
如果我运行此命令:Docker什么也没做,docker,docker-compose,Docker,Docker Compose,如果我运行此命令:docker compose up--detach: 它只返回关于Docker的默认信息: Builds, (re)creates, starts, and attaches to containers for a service. Unless they are already running, this command also starts any linked services. The `docker-compose up` command aggregates
docker compose up--detach
:
它只返回关于Docker的默认信息:
Builds, (re)creates, starts, and attaches to containers for a service.
Unless they are already running, this command also starts any linked services.
The `docker-compose up` command aggregates the output of each container. When
the command exits, all containers are stopped. Running `docker-compose up -d`
starts the containers in the background and leaves them running.
If there are existing containers for a service, and the service's configuration
or image was changed after the container's creation, `docker-compose up` picks
up the changes by stopping and recreating the containers (preserving mounted
volumes). To prevent Compose from picking up changes, use the `--no-recreate`
flag.
我怎样才能让它运行
我尝试了docker compose up-d
,它返回:
错误:无法连接到Docker守护程序-您可能需要运行
Docker machine start default`。您确定Docker守护程序正在运行吗?尝试运行以下命令:
sudo systemctl start docker
或在较旧的系统上:
sudo service docker start
您还可以使用环境变量来调试Docker守护程序的问题:
eval "$(docker-machine env default)"
然后
似乎
Docker
守护进程未运行。通过此命令启动它(暂时启动,直到下次重新启动):
如果在较旧的操作系统上:
service docker start
service docker enable
然后运行命令docker compose up-d
。如果成功,现在您应该启用docker,以便在重新启动操作系统时,守护进程自动启动:
systemctl enable docker
如果在较旧的操作系统上:
service docker start
service docker enable
您确定您所在的目录与您的
docker ompose.yml
所在的目录相同吗?