Skip to content

Instantly share code, notes, and snippets.

@antoinetavant
Created March 19, 2019 10:25
Show Gist options
  • Save antoinetavant/0ba9d56a1f600ff94593d59344f0653d to your computer and use it in GitHub Desktop.
Save antoinetavant/0ba9d56a1f600ff94593d59344f0653d to your computer and use it in GitHub Desktop.
Steps in oder to run a docker

How to launch a docker

There is what's need to be done in order to launch the docker container I need for my these.

Configuration

  • Fedora 29
  • That's all

Install docker if needed

From the docker docs.

  1. Uninstall older versions
sudo dnf -y remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine
  1. Set up the docker repository
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager \
    --add-repo \
    https://download.docker.com/linux/fedora/docker-ce.repo
  1. Install Docker CE
sudo dnf -y install docker-ce docker-ce-cli containerd.io

Start the deamon

Using systemctl utility:

sudo systemctl start docker

You can verify that everythings works with

sudo docker run hello-world

Start on boot

Using systemd:

sudo systemctl enable docker

Disable it with sudo systemctl disable docker

Adding user to the docker group

If you are tiered of using sudo for docker, try:

sudo groupadd docker
sudo usermod -aG docker $USER

Then log out and in, then test it with

docker run hello-world

If there is permission error with the dorectory ~/.docker, either remove it or change it permission with

sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
sudo chmod g+rwx "$HOME/.docker" -R

for more information, see this useful article .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment