LoginSignup
0
0

More than 1 year has passed since last update.

Docker環境構築

Posted at

概要

CentOS7上でのDocker構築手順です。
自分メモ用になります。

構築手順

1.レポジトリをyum-config-managerで管理するために、yum-utilsをインストール

sudo yum -y insgtall yum-utils

2.dockerのレポジトリをインストール

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

3.dockerをインストール

sudo yum install -y docker-ce docker-ce-cli containerd.io

4.dockerデーモンの設定ファイルを作成

sudo mkdir /etc/docker
sudo cat > /etc/docker/daemon.json <<EOF
{
      "exec-opts": ["native.cgroupdriver=systemd"],
      "log-driver": "json-file",
      "log-opts": {
            "max-size": "100m"
       },
      "storage-driver": "overlay2",
      "storage-opts": [
      "overlay2.override_kernel_check=true"
       ]
}
EOF

5.dockerサービスを起動し、サーバ起動時に自動的にサービスが起動できるようにする。

sudo systemctl start docker
sudo systemctl enable docker
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