每當我試圖建立一個開發環境,我得到這個錯誤:如何將docker-compose升級到2.0?
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
$ docker-compose --version
docker-compose version 1.5.2, build unknown
有人告訴我,我需要升級我的搬運工,撰寫。但我如何升級它?我找不到任何有關它的文檔。
任何想法?
編輯:
我試圖從這個question答案:
curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" > ./docker-compose
sudo mv ./docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
安裝/升級後,我得到這個錯誤:
-bash: /usr/bin/docker-compose: Permission denied
而且我可以運行任何容器了!
$ docker-compose --version
bash: /usr/bin/docker-compose: Permission denied
和:
$ docker-compose up -d
bash: /usr/bin/docker-compose: Permission denied
任何想法?
編輯2:
我想這從泊塢窗site:
$ curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
我仍然得到許可錯誤:
bash: /usr/bin/docker-compose: Permission denied
爲什麼???
編輯3:
Note: If you get a 「Permission denied」 error, your /usr/local/bin directory probably isn’t writable and you’ll need to install Compose as the superuser. Run sudo -i, then the two commands below, then exit.
所以,我曾嘗試:
$ sudo -i
curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
exit
然後:
$ docker-compose --version
bash: /usr/bin/docker-compose: Permission denied
沒有好...
試着用'sudo' – rokas
須藤什麼呢? – laukok