So what is Docker? According to Docker, Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.
Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.
In this post we will cover how to install Docker on Fedora 25 and create an initial Docker container.
For installing the Docker engine we will be using the packages from Fedora’s repository as they are not available from Docker at this time. Once the packages are available an updated post will be created to show how to install using the packages from Docker.
Next we need to install docker-engine. Current version in the Fedora repository is 1.12.
$ sudo dnf install docker-engine
Once the installation has completed it is time to enable the docker service to run at startup.
$ sudo systemctl enable docker.service
Now start it up.
$ sudo systemctl start docker.service
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service â /usr/lib/systemd/system/docker.service.
Now that we are running we can test docker by running the hello-world test container.
$ sudo docker run –rm hello-world
Unable to find image ‘hello-world:latest’ locally
Trying to pull repository docker.io/library/hello-world …
sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9: Pulling from docker.io/library/hello-world
c04b14da8d14: Pull complete
Status: Downloaded newer image for docker.io/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:
For more examples and ideas, visit:
To avoid having to use sudo when you use the docker command, create a group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.
Warning: The docker group is equivalent to the root user; For details on how this impacts security in your system, see Docker Daemon Attack Surface for details.
To create the docker group and add your user:
Create the docker group.
$ sudo groupadd docker
Add your user to docker group.
$ sudo usermod -a G docker <user_id>
Log out and log back in.
This ensures your user is running with the correct permissions.
Verify that your user is in the docker group by running docker without sudo.
Just incase you want to remove Docker from your system here is what you need to do.
List the installed Docker packages.
$ sudo dnf list installed | grep docker
docker.x86_64 2:1.12.3-10.git7b5044b.fc25 @updates
docker-common.x86_64 2:1.12.3-10.git7b5044b.fc25 @updates
python-dockerfile-parse.noarch 0.0.5-5.fc25 @@commandline
Remove the package.
$ sudo dnf -y remove docker-engine.x86_64
This command does not remove images, containers, volumes, or user-created configuration files on your host.
To delete all images, containers, and volumes, run the following command:
$ sudo rm -rf /var/lib/docker
There you have it, Docker is running and you can begin to create Docker containers and use them.