2014-04-16 10:53:12 +10:00
|
|
|
page_title: Installation on Fedora
|
2015-02-05 13:42:11 +10:00
|
|
|
page_description: Instructions for installing Docker on Fedora.
|
|
|
|
page_keywords: Docker, Docker documentation, Fedora, requirements, linux
|
2014-04-16 10:53:12 +10:00
|
|
|
|
|
|
|
# Fedora
|
|
|
|
|
2015-02-05 13:42:11 +10:00
|
|
|
Docker is supported on the following versions of Fedora:
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-05 13:42:11 +10:00
|
|
|
- [*Fedora 20 (64-bit)*](#fedora-20-installation)
|
|
|
|
- [*Fedora 21 and later (64-bit)*](#fedora-21-and-later-installation)
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-05 13:42:11 +10:00
|
|
|
Currently the Fedora project will only support Docker when running on kernels
|
|
|
|
shipped by the distribution. There are kernel changes which will cause issues
|
|
|
|
if one decides to step outside that box and run non-distribution kernel packages.
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-05 13:42:11 +10:00
|
|
|
## Fedora 21 and later installation
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-04 20:22:28 +00:00
|
|
|
Install the `docker` package which will install Docker on our host.
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-04 20:22:28 +00:00
|
|
|
$ sudo yum -y install docker
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-04 20:22:28 +00:00
|
|
|
To update the `docker` package:
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-04 20:22:28 +00:00
|
|
|
$ sudo yum -y update docker
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2015-02-05 13:42:11 +10:00
|
|
|
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
|
|
|
|
|
|
|
## Fedora 20 installation
|
|
|
|
|
|
|
|
For `Fedora 20`, there is a package name conflict with a system tray application
|
|
|
|
and its executable, so the Docker RPM package was called `docker-io`.
|
|
|
|
|
|
|
|
To proceed with `docker-io` installation on Fedora 20, please remove the `docker`
|
|
|
|
package first.
|
|
|
|
|
|
|
|
$ sudo yum -y remove docker
|
|
|
|
$ sudo yum -y install docker-io
|
|
|
|
|
|
|
|
To update the `docker` package:
|
|
|
|
|
|
|
|
$ sudo yum -y update docker-io
|
|
|
|
|
|
|
|
Please continue with the [Starting the Docker daemon](#starting-the-docker-daemon).
|
|
|
|
|
|
|
|
## Starting the Docker daemon
|
|
|
|
|
2014-04-23 23:48:28 +03:00
|
|
|
Now that it's installed, let's start the Docker daemon.
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2014-05-01 17:13:34 +03:00
|
|
|
$ sudo systemctl start docker
|
2014-04-16 10:53:12 +10:00
|
|
|
|
|
|
|
If we want Docker to start at boot, we should also:
|
|
|
|
|
2014-05-01 17:13:34 +03:00
|
|
|
$ sudo systemctl enable docker
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2014-04-23 23:48:28 +03:00
|
|
|
Now let's verify that Docker is working.
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2014-05-01 17:13:34 +03:00
|
|
|
$ sudo docker run -i -t fedora /bin/bash
|
2014-04-16 10:53:12 +10:00
|
|
|
|
2014-09-15 14:12:05 +10:00
|
|
|
> Note: If you get a `Cannot start container` error mentioning SELinux
|
|
|
|
> or permission denied, you may need to update the SELinux policies.
|
|
|
|
> This can be done using `sudo yum upgrade selinux-policy` and then rebooting.
|
|
|
|
|
2014-06-17 14:52:52 +03:00
|
|
|
## Granting rights to users to use Docker
|
|
|
|
|
|
|
|
The `docker` command line tool contacts the `docker` daemon process via a
|
2015-02-04 20:22:28 +00:00
|
|
|
socket file `/var/run/docker.sock` owned by `root:root`. Though it's
|
|
|
|
[recommended](https://lists.projectatomic.io/projectatomic-archives/atomic-devel/2015-January/msg00034.html)
|
|
|
|
to use `sudo` for docker commands, if users wish to avoid it, an administrator can
|
|
|
|
create a `docker` group, have it own `/var/run/docker.sock`, and add users to this group.
|
|
|
|
|
|
|
|
$ sudo groupadd docker
|
|
|
|
$ sudo chown root:docker /var/run/docker.sock
|
|
|
|
$ sudo usermod -a -G docker $USERNAME
|
2014-06-17 14:52:52 +03:00
|
|
|
|
2014-11-26 14:09:52 +10:00
|
|
|
## Custom daemon options
|
2014-06-17 14:52:52 +03:00
|
|
|
|
2014-11-26 14:09:52 +10:00
|
|
|
If you need to add an HTTP Proxy, set a different directory or partition for the
|
2015-02-05 13:42:11 +10:00
|
|
|
Docker runtime files, or make other customizations, read our Systemd article to
|
|
|
|
learn how to [customize your Systemd Docker daemon options](/articles/systemd/).
|
2014-06-17 14:52:52 +03:00
|
|
|
|
2014-05-22 07:05:19 +10:00
|
|
|
## What next?
|
|
|
|
|
|
|
|
Continue with the [User Guide](/userguide/).
|
|
|
|
|