4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu 20.04でapt install docker-composeでインストールしたらバージョンが古くてエラーが発生

Posted at

$ sudo docker-compose up
を実行したら以下のようなエラーが発生

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

https://docs.docker.com/compose/install/
を見てみると、apt installでインストールされたバージョン1.25.0よりも新しい1.25.5が存在していたので、それをインストールしたら解決した。

まず
$ sudo apt remove docker-compose
でdocker-composeをアンインストール

あとは公式ページの手順に従い
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

$ sudo chmod +x /usr/local/bin/docker-compose

$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
でインストール完了

$ docker-compose --version
version 1.25.5, build 8a1c60f6

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?