Docker is a software which automates the deployment of applications inside Linux containers, by providing an additional layer of abstraction. This guarantees that it will always run the same, regardless of the environment it is running in. Docker uses the resource isolation features of the Linux kernel such as cgroups and kernel namespaces to allow independent containers to run within a single Linux instance, avoiding the overhead of starting and maintaining virtual machines.
In this tutorial we will setup and launch Docker software on Fedora 23 (64-bit) release.
Prerequisites for Docker installation on Fedora release:
Fedora version: Fedora 22 (64-bit) or higher
kernel version: 3.10 or higher
[root@docker ~]# uname -r
4.3.5-300.fc23.x86_64
[root@docker ~]# cat /etc/fedora-release
Fedora release 23 (Twenty Three)
Steps:
1. Update the system
[root@docker ~]# dnf update
2. Create Docker Repository
[root@docker ~]# touch /etc/yum.repos.d/docker.repo
Edit docker.repo file and modify it to look like below:
[docker]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/fedora/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
Verify Docker Repository:
[root@docker ~]# dnf repolist
repo id repo name status
docker Docker Repository 12
*fedora Fedora 23 - x86_64 46074
*updates Fedora 23 - x86_64 - Updates 15699
3. Install Docker package
[root@docker ~]# dnf install docker-engine
4. Enable and start Docker daemon
[root@docker ~]# systemctl enable docker
[root@docker ~]# systemctl start docker
5. Test Docker installation
[root@docker ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
03f4658f8b78: Pull complete
a3ed95caeb02: Pull complete
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/