我有一台相对较旧的Windows计算机,因此我必须安装Docker Toolbox而不是Docker Desktop。 documentation说Docker Toolbox已经包含Compose和其他必要的应用-
适用于Windows的Docker桌面和Docker Toolbox已包含Compose和其他Docker应用程序,因此大多数Windows用户不需要单独安装Compose。
但是当我尝试从终端运行docker-compose
时,它说找不到命令。
npm run docker:init
> @freecodecamp/freecodecamp@0.0.1 docker:init C:\Users\Manish\Documents\Development\Github\FCC\FreeCodeCamp
> docker-compose run -u root --rm freecodecamp bash change_volumes_owner.sh && docker-compose run -u root --rm client bash -c "cd .. && bash change_volumes_owner.sh" && docker-compose run -u root --rm api-server bash -c "cd .. &&
bash change_volumes_owner.sh"
'docker-compose' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
我确实已成功安装Docker Toolbox。这是我从开始菜单运行“ Docker快速启动终端”时的输出-
Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Regenerate TLS machine certs? Warning: this is irreversible. (y/n): Regenerating TLS certificates
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
而且,docker也在PATH上-
如果Docker Toolbox已经包含Docker Compose,为什么它不起作用?
答案 0 :(得分:1)
我有同样的问题。将C:\Program Files\Docker Toolbox\
添加到系统变量的PATH中,然后重新启动终端对我有用。