diff --git a/wiki/docker.md b/wiki/docker.md index 1de3013..921f4fc 100644 --- a/wiki/docker.md +++ b/wiki/docker.md @@ -1,7 +1,7 @@ # Docker Docker is a virtualization software that deploys docker containers. -Due to easy handling and reproducable environments it is a useful tool. +Due to easy handling and reproducible environments it is a useful tool. ## Setup @@ -23,36 +23,40 @@ This section addresses various features of Docker. ### Virtualize Operating Systems -Docker is a tool that can be used to virtualize different programs and softwares. +Docker is a tool that can be used to virtualize different programs and software. Especially for containerizing and virtualizing operating systems (mostly based on -[Linux](/wiki/linux.md)) can be handled by [distrobox](https://github.com/89luca89/distrobox). +[Linux](/wiki/linux.md)) can be handled by [Distrobox](https://github.com/89luca89/distrobox). ### Run Docker as non-root user To run docker as a non-root user you need to add your user to the `docker` group. -To do this create the group docker if it doesn't exist `sudo groupadd docker` +To do this, create the group docker if it doesn't exist `sudo groupadd docker` and then add your user to the group using `sudo usermod -aG docker $USER`. -After that relog into your machine and you should be able to run -`docker run hello-world`. +After that log back into your machine. +Then you should be able to run the following. -### Tools and Visualisation +```sh +docker run hello-world +``` + +### Tools and Visualization The programs below are useful docker-management systems in different style. -- [ctop](https://github.com/bcicen/ctop): top-like cli interface for containers -- [portainer](https://www.portainer.io/): web ui for managing docker and kubernetes +- [ctop](https://github.com/bcicen/ctop): top-like CLI interface for containers +- [Portainer](https://www.portainer.io/): web UI for managing docker and Kubernetes ### Enable Nvidia GPUs -To use Nvidia GPUs with docker you need to install the nvidia-cuda-toolkit. -There is a [guide on marmelab](https://marmelab.com/blog/2018/03/21/using-nvidia-gpu-within-docker-container.html) -that focusses on that topic. +To use Nvidia GPUs with docker you need to install the Nvidia CUDA toolkit. +There is a [guide on Marmelab](https://marmelab.com/blog/2018/03/21/using-nvidia-gpu-within-docker-container.html) +that focuses on that topic. ### Block remote port access If you configured a [reverse proxy](/wiki/reverse-proxy.md) to a port chances -are you don't want the port to be accessed outside of the proxy. -Especially if you set up a authentication over nginx the open port will avoid +are you don't want the port to be accessed outside the proxy. +Especially if you set up an authentication over nginx the open port will avoid the authentication. This can be changed at the forwarded docker-service by replacing for example `-p 7000:7000` with `-p 172.17.0.1:7000:7000`. @@ -62,29 +66,49 @@ network, effectively banning remote access. If you use [Traefik](./traefik.md) it is not needed, because you don't have to publish ports to reverse proxy them. -### Dockerize a graphical application +### Containerize a graphical application -A graphical application can easily be dockerized and made available over both +A graphical application can easily be containerized using Docker and made available over both the [web browser](/wiki/web_browser.md) or [VNC](/wiki/vnc.md). For this [jlesages baseimage-gui container](https://hub.docker.com/r/jlesage/baseimage-gui) can be used. -## Troubleshooting +### Find the Container and the Mounting Point of a Volume + +Sometimes it is unclear which container a volume belongs to. +This is especially the case if the volume was created automatically and not manually or explicitly +during the setup. + +The following command will output the container a volume with the name `` belongs to. + +```sh +docker ps -a --filter volume= +``` + +Additionally, the mounting point is also of interest. +To display it, run the following command where `` is the name of the container the +volume belongs to. + +```sh +docker inspect +``` + +## Troubleshooting This section will focus on errors and the fixing of errors of docker. ### `Error saving credentials: 'Cannot autolaunch D-Bus without X11 $DISPLAY'` -As explained by +As explained by [gotam19 in a Docker forum post](https://forums.docker.com/t/docker-login-fails-with-error-message-saving-credentials-cannot-autolaunch-d-bus-without-x11-display/77789) -this error message only occurs on [Linux](/wiki/linux.md) when trying to login or pulling a Docker +this error message only occurs on [Linux](/wiki/linux.md) when trying to log in or pulling a Docker image. -To fix it install [GPG](/wiki/linux/gpg.md) and the `pass` +To fix it install [GPG](/wiki/linux/gpg.md) and the `pass` [package](/wiki/linux/package_manager.md). -Afterwards running the following command should will perform the login to the Docker servers and -the error message should not come up again. +Afterward running the following command perform the login to the Docker servers and the error +message should not come up again. -```sh +```sh docker login ``` diff --git a/wiki/vnc.md b/wiki/vnc.md index 92d2444..4599ed4 100644 --- a/wiki/vnc.md +++ b/wiki/vnc.md @@ -6,7 +6,7 @@ It is based on the Remote Frame Buffer protocoll which is also named RFB. VNC is especially used for accessing graphical applications or [terminals](/wiki/linux/system_console.md) of a remote server, -[dockerized](/wiki/docker.md#dockerize-a-graphical-application) or virtualized +[dockerized](/wiki/docker.md#containerize-a-graphical-application) or virtualized program. ## VNC Clients