Ubuntu 21.10にDocker Compose2.1.1をインストールする

環境
1.OSバージョンの確認

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10"

2.dockerバージョンの確認

# docker version
Client: Docker Engine - Community
 Version:           20.10.11
 API version:       1.41
 Go version:        go1.16.9
 Git commit:        dea9396
 Built:             Thu Nov 18 00:37:21 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.11
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.9
  Git commit:       847da18
  Built:            Thu Nov 18 00:35:27 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

インストールの方法
1.ダウンロード先を確認します

 # ls -l /usr/libexec/docker/cli-plugins/
合計 105796
-rwxr-xr-x 1 root root 33621272 Nov 17 16:35 docker-app
-rwxr-xr-x 1 root root 61462129 Nov 17 16:35 docker-buildx
-rwxr-xr-x 1 root root 13246464 Oct 25 00:42 docker-scan

ダウンロード先に移動します
# cd /usr/libexec/docker/cli-plugins/

2.docker-compose 2.1.1のダウンロード

# sudo wget https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64

権限を付与します
# sudo chmod +x docker-compose-linux-x86_64

フォルダ名を変更します
# sudo mv docker-compose-linux-x86_64 docker-compose

3.バージョンを確認します
# docker compose version
Docker Compose version v2.1.1

Ubuntu 21.10

Posted by arkgame