2
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.

Ubuntu 16.04にDockerとDocker-composeをインストール

Last updated at Posted at 2018-06-29

Ubuntu 16.04にDockerとDocker-composeをインストール

First of all

sudo apt-get update
sudo apt-get install git

Prepare project user

sudo useradd -m -s /bin/bash admin
sudo su - admin
ssh-keygen -t rsa -b 4096 // This is for deploy key.

Set up docker official repository

Install packages to allow apt to use a repository over HTTPS.

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Install Docker CE (Community Edition)

sudo apt-get update
sudo apt-get install docker-ce
docker -v

Install Docker-compose

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

Set docker group to project user

sudo gpasswd -a admin docker
sudo systemctl restart docker
2
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
2
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?