Files
org-roam/20230414160603-docker.org
2025-11-05 09:18:11 +01:00

1.9 KiB

docker

Docker ist the programm designed to self-host services on the web through so called container. A container is a closed system, that can interact with other containers. One Container can run one application and expose this application to a port on the server. A list of all deployed and undeployed containers can be found in the list of docker containers.

To Start a container use

 docker run <docker image>

You can use an application called docker-compose to start multiple containers simultaneously and define variables and settings for them beforehand.

Additionally you can set the following parameters (listed below) together with the run command. Those parameters are important to get the containers running and can also be implemented into docker-compose.

run parameters

 --name "<name of container>"

creates a verbose name for the container. If no container name is set, docker choooses a random one.

  -v "<volume directory of host>:<volume directory of container>"

Mounts a volume to the container. This Volume is located at the given path in the host file system and all files in the given folder are represantations of the same files in the container folder of the given container path.

  -e "<ENVIRONMENT_VARIABLE>"

Sets a desired environment variable for the container.

--network  "<docker network>"

Connects the container to the given docker-networks