1
1

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 5 years have passed since last update.

AzureVM(ubuntu 18)にdocker&docker-composeをインストール

Last updated at Posted at 2019-05-18

tl;dr

AzureVM(ubuntu server 18.04 LTS)にdockerをインストールします。

dockerのインストール

$ sudo apt update
$ sudo apt install -y apt-transport-https gnupg-agent
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
$ sudo apt-get install -y docker-ce

ここで一旦dockerの起動を確認します。

$ sudo docker run hello-world

問題がなければ「Hello from Docker!」と表示されます。

#dockerの便利設定
sudoなしでのdocker実行、dockerの常時起動設定です。

$ sudo usermod -aG docker $USER
$ sudo systemctl start docker
$ sudo systemctl enable docker

設定後、再起動します。

docker-composeのインストール

curlコマンドで取得するバイナリのバージョンに注意!

$ sudo curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose

docker-composeの動作確認

$ docker-compose --version

問題がなければdocker-composeのバージョンが表示されます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?