Infrastructure 2018-06-09

Setting Up a Docker Environment on Sakura VPS

Step-by-step guide to installing Docker CE on Sakura VPS running CentOS. Covers yum repository setup, stable vs. edge channel configuration, and Docker CE installation commands.

Read in: ja
Setting Up a Docker Environment on Sakura VPS

Overview

Set up a Docker environment on Sakura VPS. Initial server settings, etc., are omitted.

Setup Procedure

All operations are assumed to be performed by a regular user with sudo privileges.

Docker has a free CE version and a commercial EE version, but we will use the CE version this time.

Set Up the Repository

Installation

sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

Set Up the Stable Repository

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

Set Up the Edge and Test Repositories

sudo yum-config-manager --enable docker-ce-edge
sudo yum-config-manager --enable docker-ce-test

Since we only want to use stable, disable them with --disable.

sudo yum-config-manager --disable docker-ce-edge
sudo yum-config-manager --disable docker-ce-test

Install Docker CE

sudo yum install docker-ce

You can check the available versions for installation with the following command.

yum list docker-ce --showduplicates | sort -r

To install a specified version, specify the version as follows.

sudo yum install docker-ce-<VERSION STRING>

Start Docker

sudo systemctl start docker

Check if it's running.

sudo docker run hello-world

Uninstall Docker CE

sudo yum remove docker-ce

Docker images, volumes, containers, and configuration files are not automatically deleted, so manually delete the following directory.

sudo rm -rf /var/lib/docker

References

Tags: Docker Sakura VPS
Share: 𝕏 Post Facebook Hatena
✏️ View source / Discuss on GitHub
☕ Support

If you enjoy this blog, consider supporting it. Every bit helps keep it running!


Related Articles