Setup Docker on bare-metal server

  1. Install Ubuntu
  2. Install sshd by the following command

sudo apt-get install openssh-client openssh-server

  1. Login the server remotely, and install docker

sudo apt-get install docker.io

  1. In China, you will need to setup your docker image accelerator
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://y2wog5ns.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
  1. Setup the user who can run docker instead of by sudo
sudo usermod -aG docker ${USER}
su - ${USER}

你可能感兴趣的:(Setup Docker on bare-metal server)