LoginSignup
1
0

More than 3 years have passed since last update.

UbuntuやDebianにDocker環境を作成する

Last updated at Posted at 2021-04-04

■必要なライブラリをインストールする

apt install -y \
  apt-transport-https \
  ca-certificates \
  curl \
  software-properties-common
# Debianのイメージにもよると思いますが、debianは下記も必要でした
apt install -y \
    gnupg

■Ubuntu

DOCKER_COMPOSE_VERSION=1.28.5

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
  && curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
  && chmod +x /usr/local/bin/docker-compose \
  && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \
  && apt update -y \
  && apt install -y \
    docker-ce

■Debian

# docker-composeは入れていません
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add  - \
    && add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
    && apt update \
    && apt install -y \
        docker-ce
1
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
1
0