Commit 735bdd8b8c5bbddf30378be760c2c4e3d43917f0

Authored by Benjamin Rühl
1 parent 219e73bf

Add documentation about docker

Showing 2 changed files with 71 additions and 0 deletions
README.md
... ... @@ -115,6 +115,7 @@ In addition to this general documentation, the directory `docu/` also contains s
115 115 General
116 116  
117 117 - [infrastructure](docu/infrastructure.md) - The individual modules of the application
  118 +- [docker](docu/docker.md) - Docker tips and tricks
118 119 - [persistence](docu/persistence.md) - DAOs, Entities, Hibernate, PostgreSQL
119 120 - [adminer](docu/adminer.md) - Database management web app
120 121  
... ...
docu/docker.md 0 → 100644
  1 +# Docker tips and tricks
  2 +
  3 +[Docker](https://www.docker.com/what-docker) is a container virtualizing tool that hosts the different processes of the chat bot project in a platform independent way without the need to install technologies like JBoss and PostgreSQL directly on a development or production machine.
  4 +Docker compose is an extension that brings simplified possibilities for running and connecting multiple containers together. It cannot manage containers running on different machines though.
  5 +
  6 +## Command overview
  7 +
  8 +Docker compose
  9 +
  10 +- `docker-compose up`: start containers defined in `docker-compose.yml` in the current directoy
  11 +- `docker-compose up --build`: start containers defined in `docker-compose.yml` in the current directoy and make sure the containers are rebuilt from their images
  12 +- `docker-compose down`: shut down containers defined in `docker-compose.yml` in the current directoy
  13 +
  14 +Docker
  15 +
  16 +- `docker ps`: list all containers running on machine
  17 +
  18 +## Known issues and troubleshooting
  19 +
  20 +**Before jumping to the individual issues, the following hint should be read.** When working with docker a lot of problems came up almost all the time. There seem to be still some problems in the core docker engine. Updates for Docker are delivered frequently which sometimes fixes issues but most often does not. The most common solutions to many unresolvable issues are the following:
  21 +
  22 +1. restart the docker service
  23 +2. restart the machine
  24 +3. remove all containers and images
  25 +4. reset docker to factory defaults or reinstall
  26 +
  27 +At least the first two should be given a try if errors seem to make no sense at all.
  28 +
  29 +### Issue: Windows named pipe error
  30 +
  31 +```
  32 +ERROR: Windows named pipe error: The system cannot find the file specified. (code: 2)
  33 +```
  34 +
  35 +The docker service seems to be not running. Do not forget to start Docker before executing commands.
  36 +
  37 +### Issue: Port is already allocated
  38 +
  39 +```
  40 +Error: port is already allocated
  41 +```
  42 +
  43 +Very common. Use `docker ps` to see if containers are running with the same port. Shut down all running containers. Restart Docker service.
  44 +
  45 +### Issue: Name is already in use by container
  46 +
  47 +```
  48 +Error response from daemon: Conflict. The name "{container-name}" is already in use by container {container-hash}. You have to delete (or rename) that container to be able to reuse that name.
  49 +```
  50 +
  51 +Shut down containers. Restart docker. Clear containers, images and maybe volumes. See [Github issue](https://github.com/moby/moby/issues/23371)
  52 +
  53 +### Issue: IOError: Failed to execute script docker-compose
  54 +
  55 +```
  56 +IOError: [Errno 0] Error
  57 +Failed to execute script docker-compose
  58 +```
  59 +
  60 +Seems to be Windows only. Try executing your command directly in the powershell instead of an IDE like IntelliJ or Visual Studio Code. See [Github issue](https://github.com/docker/compose/issues/5019).
  61 +
  62 +### Issue: FileNotFoundException: server.log (Permission denied)
  63 +
  64 +```
  65 +Caused by: java.io.FileNotFoundException: /opt/jboss/wildfly/standalone/log/server.log (Permission denied)
  66 + at java.io.FileOutputStream.open0(Native Method)
  67 + at ...
  68 +```
  69 +
  70 +Common and nasty. Most often restarting the Docker service hepls. Sometimes multiple restarts are required.
0 71 \ No newline at end of file
... ...