Docker on Fedora 27
This walks you through the steps to install the Community Edition of Docker on Fedora 27. If you’ve been living under a rock for a few years, Docker is an open source container virtualization software.
Docker or Docker Community Edition is a necessary step if you want to install something like Microsoft’s SQL Server on Fedora because only these are supported platforms:
- Red Hat Enterprise Linux 7.3 or 7.4
- SUSE Linux Enterprise Server V12 SP2
- Ubuntu 16.04
- Docker Engine 1.8+
The first step requires you to add the docker-ce
repo to your instance with he curl
utility, which should already be installed in most cases. You can check whether the curl
utility is available with the which
command, like:
which -a curl |
If installed it should return the following:
/usr/bin/curl /bin/curl |
You add the docker-ce
repo with the following curl
command:
sudo curl -o /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/fedora/docker-ce.repo |
You should see something like the following if it was successful:
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2544 100 2544 0 0 2544 0 0:00:01 --:--:-- 0:00:01 12913 |
Next, you can install docker-ce
with the following yum
command or if you prefer use the dnf
utility:
sudo yum install -y docker-ce |
It should produce a log file like the one provided, which you can see by clicking the Display detailed console link that expands the page to show you the console details.
Display detailed console →
Docker CE Stable - x86_64 30 kB/s | 5.9 kB 00:00 Last metadata expiration check: 0:00:00 ago on Thu 05 Jul 2018 06:56:36 PM MDT. Dependencies resolved. ================================================================================================ Package Arch Version Repository Size ================================================================================================ Installing: docker-ce x86_64 18.03.1.ce-1.fc27 docker-ce-stable 35 M Installing dependencies: container-selinux noarch 2:2.65-1.gitbf5b26b.fc27 updates 41 k Transaction Summary ================================================================================================ Install 2 Packages Total download size: 35 M Installed size: 150 M Downloading Packages: (1/2): container-selinux-2.65-1.gitbf5b26b.fc27.noarch.rpm 133 kB/s | 41 kB 00:00 (2/2): docker-ce-18.03.1.ce-1.fc27.x86_64.rpm 20 MB/s | 35 MB 00:01 ------------------------------------------------------------------------------------------------ Total 14 MB/s | 35 MB 00:02 warning: /var/cache/dnf/docker-ce-stable-8cf73e63b8c72e93/packages/docker-ce-18.03.1.ce-1.fc27.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY Importing GPG key 0x621E9F35: Userid : "Docker Release (CE rpm) <docker@docker.com>" Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 From : https://download.docker.com/linux/fedora/gpg Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : container-selinux-2:2.65-1.gitbf5b26b.fc27.noarch 1/2 Running scriptlet: container-selinux-2:2.65-1.gitbf5b26b.fc27.noarch 1/2 neverallow check failed at /var/lib/selinux/targeted/tmp/modules/100/base/cil:9006 (neverallow base_typeattr_7 unlabeled_t (file (entrypoint))) <root> allow at /var/lib/selinux/targeted/tmp/modules/200/container/cil:1489 (allow spc_t unlabeled_t (file (entrypoint))) <root> allow at /var/lib/selinux/targeted/tmp/modules/100/sandboxX/cil:866 (allow sandbox_x_domain exec_type (file (entrypoint))) <root> allow at /var/lib/selinux/targeted/tmp/modules/100/virt/cil:1669 (allow virtd_lxc_t exec_type (file (entrypoint))) <root> allow at /var/lib/selinux/targeted/tmp/modules/100/virt/cil:2060 (allow svirt_sandbox_domain exec_type (file (entrypoint))) Failed to generate binary /usr/sbin/semodule: Failed! Running scriptlet: docker-ce-18.03.1.ce-1.fc27.x86_64 2/2 Installing : docker-ce-18.03.1.ce-1.fc27.x86_64 2/2 Running scriptlet: docker-ce-18.03.1.ce-1.fc27.x86_64 2/2 Running as unit: run-rb873740b51a44061abb2c9e197871e4b.service Verifying : docker-ce-18.03.1.ce-1.fc27.x86_64 1/2 Verifying : container-selinux-2:2.65-1.gitbf5b26b.fc27.noarch 2/2 Installed: docker-ce.x86_64 18.03.1.ce-1.fc27 container-selinux.noarch 2:2.65-1.gitbf5b26b.fc27 Complete! |
After installing docker-ce
, you can check it with the following systemctl
command:
sudo systemctl status docker |
It should show service is disabled (default) and inactive:
● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: https://docs.docker.com |
This indicates everything installed correctly, now you need to enable the docker
service with this systemctl
command:
sudo systemctl enable docker |
It should show that the docker
service is enabled and inactive:
● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: inactive (dead) Docs: https://docs.docker.com |
You start the docker
service with this systemctl
command:
sudo systemctl start docker |
It should show that the service is enabled and inactive:
● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2018-07-05 19:22:25 MDT; 4s ago Docs: https://docs.docker.com Main PID: 107768 (dockerd) Tasks: 16 Memory: 35.8M CPU: 140ms CGroup: /system.slice/docker.service ├─107768 /usr/bin/dockerd └─107772 docker-containerd --config /var/run/docker/containerd/containerd.toml Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.350914727-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.352583385-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.352718174-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.353419088-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.632193965-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.823732094-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.893601936-06:00 Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.894351396-06:00 Jul 05 19:22:25 localhost.localdomain systemd[1]: Started Docker Application Container Engine. Jul 05 19:22:25 localhost.localdomain dockerd[107768]: time="2018-07-05T19:22:25.907087735-06:00 lines 1-22/22 (END) |
A CNTL+C
dismisses the open log file. As usual, I hope this helps those trying to accomplish the task for the first time.