|
| 1 | +# Docker Information |
| 2 | + |
| 3 | +Developer Dockerfile can be used to set up the development environment. |
| 4 | +It includes all the necessary tools, libraries, and dependencies required |
| 5 | +for development. This ensures that all developers work in a consistent |
| 6 | +environment, reducing the "it works on my machine" problem. |
| 7 | +Documentation Dockerfile is used to build project's documentation. |
| 8 | + |
| 9 | +Project uses Docker Compose to manage both the Developer Dockerfile and the |
| 10 | +Documentation Dockerfile. Docker Compose simplifies the process of building |
| 11 | +and running multiple Docker containers, ensuring that both the development |
| 12 | +environment and the documentation container are consistently set up and managed. |
| 13 | + |
| 14 | +## Build the docker image |
| 15 | + |
| 16 | +If you have docker compose installed, you can use this command |
| 17 | + |
| 18 | + docker-compose -f docker/docker-compose.yaml build |
| 19 | + |
| 20 | +If you do not want to use docker compose, you can use this command instead |
| 21 | + |
| 22 | + docker build -f docker/<dockerfile_name> -t <image_name> . |
| 23 | + |
| 24 | +This will build the image from the Dockerfile in the current directory (the `.`). |
| 25 | + |
| 26 | +## Run the docker container |
| 27 | + |
| 28 | +If you have docker compose installed, the easiest way is to call |
| 29 | + |
| 30 | + docker compose -f docker/docker-compose.yaml run <service_name> |
| 31 | + |
| 32 | +If you do not want to use docker compose, you can use this command instead |
| 33 | + |
| 34 | + docker run -it --rm -v $PWD:$PWD --workdir $PWD <image_name> |
| 35 | + |
| 36 | +This command creates the docker container and enters it (`-it` for interactive). |
| 37 | +The container will be removed when you leave it again (`--rm`). |
| 38 | +Your current directory is mounted into the container. This is set up as the working |
| 39 | +directory in the container (`-v $PWD:$PWD --workdir $PWD`). |
0 commit comments