Fedora 26: Install docker-engine for container

This article will describe installing docker-engine. Please see here for usage of Docker.

1 Install docker-engine

The following script will install docker-engine.

#!/bin/sh

set -e

# Install docker-engine.
URL=https://docs.docker.com
PASS=${URL}/engine/installation/linux/repo_files/fedora/docker.repo
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo ${PASS}
sudo mkdir -p /var/lib/docker # docker-engine-selinux issue
sudo dnf install -y docker-engine
sudo systemctl start docker
sudo systemctl enable docker

# Add docker group for running docker without sudo.
sudo groupadd docker
sudo gpasswd -a "${USER}" docker
sudo reboot

2 Execution result

Run hello-world.

$ docker run hello-world
<snip>
Hello from Docker!
<snip>