LoginSignup
0
0

More than 1 year has passed since last update.

UbuntuにDocker-composeをインストールする手順

Posted at

事前知識

UbuntuにDocker-composeをインストールする手順

1.パッケージをアップデートする

  • コマンド
sudo apt-get update
  • 実行例
$ sudo apt-get update
[sudo] password for ユーザ名:
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
...省略

2.必要なパッケージをインストール

  • コマンド
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  • 実行例
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
...省略

3.docker-composeのインストール

  • コマンド
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • 実行例
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 12.1M  100 12.1M    0     0  10.4M      0  0:00:01  0:00:01 --:--:-- 25.4M

4.chmod でdocker-composeコマンドを扱えるようにする

  • コマンド
sudo chmod +x /usr/local/bin/docker-compose

5.docker-composeのバージョン確認

  • コマンド
docker-compose -v
  • 実行例
$ docker-compose -v
docker-compose version 1.29.2, build 5becea4c

関連

0
0
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
0
0