LoginSignup
0
0

More than 3 years have passed since last update.

[シェルスクリプト]Debian環境で一発でDocker構築するシェルスクリプトを書いた

Last updated at Posted at 2020-12-10

Debian環境でDockerをインストールするシェルスクリプトを書いたので備忘録として載せます

#!/bin/sh
set -e

# aptパッケージの更新
sudo apt-get update

# パッケージをインストール
sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common

# Dockerの公式GPGキーを追加
sudo curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

# 安定したリポジトリを設定
sudo add-apt-repository \
     "deb [arch=amd64] https://download.docker.com/linux/debian \
     $(lsb_release -cs) \
     stable"

# aptパッケージの更新
sudo apt-get update

# Dockerのインストール
sudo apt-get install docker-ce docker-ce-cli containerd.io

# docker-composeのインストール
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
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