Installing Docker on Fedora

$ sudo dnf install -y docker origin-clients

# (Optional) Add yourself into the `docker` user group to avoid needing sudo
$ sudo groupadd docker && sudo gpasswd -a ${USER} docker && sudo systemctl restart docker
$ sudo systemctl start docker

# Then in `/etc/containers/registries.conf`, add to `registries.insecure`

$ newgrp docker
$ oc cluster up

Also see:


Start a container with a bash prompt

$ docker run --entrypoint /bin/bash -i -t <image_name>

Start a shell inside a running container

$ docker exec -it <container name> /bin/bash

Mount a volume in a container with SELinux

$ docker run -d -p 49001:8080 -v $JENKINS_VOLUME:/var/jenkins_home:z -t jenkins


Why did a container exit unexpectedly?

  • docker ps -a to show exited containers
  • docker logs <container-id> to see whether anything obvious was thrown in the logs
  • docker inspect <container-id> - check the ‘State’ object, which should show the container’s exit code
  • Check /var/log/messages to see whether Docker was updated by a package manager (e.g. yum)