August 11, 2019

Install Docker Community Edition (CE) on Fedora 30

Uninstall old versions.


# dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

Install the dnf-plugins-core package which provides the commands to manage your DNF repositories from the command line.


# dnf install -y dnf-plugins-core

Install Docker Community Edition (CE) stable repository.


# dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Install Docker Community Edition (CE).


# dnf install -y docker-ce docker-ce-cli containerd.io

Start Docker.


# systemctl start docker; systemctl enable docker

Test it


# docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete 
Digest: sha256:6540fc08ee6e6b7b63468dc3317e3303aae178cb8a45ed3123180328bcc1d20f
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.
    (amd64)
 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 ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

https://docs.docker.com/install/linux/docker-ce/fedora/

Running docker as non privilege user


docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

To run docker as non privileges user, you need to add that user to the docker group and then login out and login in again.


sudo usermod -a -G docker $USER

https://techoverflow.net/2017/03/01/solving-docker-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket/

No comments: