Fedora 29: Install Docker for container

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

1 Install Docker

The following script will install Docker.

#!/bin/sh -e

# Install docker.
sudo dnf install -y docker
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>