Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| docker_installation_on_fedora [2019/01/24 10:05] – [Registering the Docker repository] rpjday | docker_installation_on_fedora [2019/01/24 14:01] (current) – [Installing Docker and Docker Compose] rpjday | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| How to install and test Docker and friends on current Fedora 29. | How to install and test Docker and friends on current Fedora 29. | ||
| + | |||
| + | Extra: | ||
| + | |||
| + | * '' | ||
| + | |||
| ===== Links ===== | ===== Links ===== | ||
| Line 9: | Line 14: | ||
| * [[https:// | * [[https:// | ||
| - | ===== Get rid of any earlier Docker | + | ===== Get rid of earlier Docker/container content |
| Fedora' | Fedora' | ||
| Line 38: | Line 43: | ||
| docker-engine | docker-engine | ||
| $ | $ | ||
| + | </ | ||
| + | |||
| + | or possibly just: | ||
| + | |||
| + | < | ||
| + | $ sudo dnf remove " | ||
| </ | </ | ||
| Line 71: | Line 82: | ||
| < | < | ||
| - | $ sudo dnf install docker-ce docker-compose | + | $ sudo dnf install docker-ce |
| </ | </ | ||
| - | You should | + | resulting in: |
| + | |||
| + | < | ||
| + | Installing: | ||
| + | | ||
| + | | ||
| + | | ||
| + | Installing dependencies: | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | |||
| + | Should create group '' | ||
| + | ===== Docker RPM scripts ===== | ||
| + | |||
| + | ==== preinstall ==== | ||
| + | |||
| + | < | ||
| + | if [ $1 -gt 0 ] ; then | ||
| + | # package upgrade scenario, before new files are installed | ||
| + | |||
| + | # clear any old state | ||
| + | rm -f / | ||
| + | |||
| + | # check if docker service is running | ||
| + | if systemctl is-active docker > /dev/null 2>& | ||
| + | systemctl stop docker > /dev/null 2>&1 || : | ||
| + | touch / | ||
| + | fi | ||
| + | fi | ||
| + | </ | ||
| + | |||
| + | ==== postinstall ==== | ||
| + | |||
| + | < | ||
| + | if [ $1 -eq 1 ] ; then | ||
| + | # Initial installation | ||
| + | systemctl --no-reload preset docker &>/ | ||
| + | fi | ||
| + | |||
| + | if ! getent group docker > /dev/null; then | ||
| + | groupadd --system docker | ||
| + | fi | ||
| + | ... EE stuff snipped ... | ||
| + | </ | ||
| + | |||
| + | ==== preuninstall ==== | ||
| + | |||
| + | < | ||
| + | if [ $1 -eq 0 ] ; then | ||
| + | # Package removal, not upgrade | ||
| + | systemctl --no-reload disable --now docker &>/ | ||
| + | fi | ||
| + | |||
| + | update-alternatives --remove dockerd / | ||
| + | </ | ||
| + | ==== postuninstall ==== | ||
| + | |||
| + | < | ||
| + | if [ $1 -ge 1 ] ; then | ||
| + | # Package upgrade, not uninstall | ||
| + | systemctl try-restart docker &>/ | ||
| + | fi | ||
| + | </ | ||
| + | ===== Starting | ||
| + | |||
| + | < | ||
| + | $ systemctl status docker.service | ||
| + | ● docker.service - Docker Application Container Engine | ||
| + | | ||
| + | | ||
| + | Docs: https:// | ||
| + | $ | ||
| + | </ | ||
| < | < | ||
| Line 85: | Line 169: | ||
| < | < | ||
| $ systemctl status docker | $ systemctl status docker | ||
| + | ● docker.service - Docker Application Container Engine | ||
| + | | ||
| + | | ||
| + | Docs: https:// | ||
| + | Main PID: 16470 (dockerd) | ||
| + | Tasks: 46 | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | $ | ||
| </ | </ | ||
| - | Finally, you can test your installation | + | ===== Testing |
| < | < | ||
| $ sudo docker run hello-world | $ sudo docker run hello-world | ||
| + | Unable to find image ' | ||
| + | latest: Pulling from library/ | ||
| + | 1b930d010525: | ||
| + | Digest: sha256: | ||
| + | Status: Downloaded newer image for hello-world: | ||
| Hello from Docker! | Hello from Docker! | ||
| Line 108: | Line 208: | ||
| Share images, automate workflows, and more with a free Docker ID: | Share images, automate workflows, and more with a free Docker ID: | ||
| - | | + | |
| For more examples and ideas, visit: | For more examples and ideas, visit: | ||
| - | | + | |
| $ | $ | ||
| </ | </ | ||
| Line 137: | Line 237: | ||
| $ docker run hello-world | $ docker run hello-world | ||
| ... etc etc ... | ... etc etc ... | ||
| + | </ | ||
| + | |||
| + | ===== Running Ubuntu bash ===== | ||
| + | |||
| + | < | ||
| + | $ docker run -it ubuntu bash | ||
| + | Unable to find image ' | ||
| + | latest: Pulling from library/ | ||
| + | 38e2e6cd5626: | ||
| + | 705054bc3f5b: | ||
| + | c7051e069564: | ||
| + | 7308e914506c: | ||
| + | Digest: sha256: | ||
| + | Status: Downloaded newer image for ubuntu: | ||
| + | root@f7c76c6f0ee4:/# | ||
| + | uid=0(root) gid=0(root) groups=0(root) | ||
| + | root@f7c76c6f0ee4:/# | ||
| + | </ | ||
| + | |||
| + | From another session: | ||
| + | |||
| + | < | ||
| + | # docker ps | ||
| + | CONTAINER ID IMAGE | ||
| + | f7c76c6f0ee4 | ||
| </ | </ | ||