wiki:docker_troubleshooting
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:docker_troubleshooting [2022/07/19 11:38] – add Volume shadowing antisa | wiki:docker_troubleshooting [2026/07/16 11:11] (current) – add network doesn't exist error antisa | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| Restart the docker service: | Restart the docker service: | ||
| systemctl restart docker.service | systemctl restart docker.service | ||
| + | |||
| + | Or create that chain in filter table | ||
| + | iptables -t filter -N DOCKER-ISOLATION-STAGE-1 | ||
| This is [[https:// | This is [[https:// | ||
| Line 64: | Line 67: | ||
| </ | </ | ||
| When the container builds now there won't be a directory called " | When the container builds now there won't be a directory called " | ||
| + | |||
| + | To get around this you will have to create this extra directory on the host and change it's permissions accordingly or define a new volume for this extra directory only. | ||
| + | |||
| + | ===== Error pulling image ... 404 Client Error===== | ||
| + | |||
| + | Might happen when trying to create the container without building the image first. | ||
| + | |||
| + | Full error: | ||
| + | Error pulling image myimage: | ||
| + | |||
| + | Check if the image is built and exist before creating container | ||
| + | |||
| + | docker image ls | ||
| + | |||
| + | ===== --chmod option requires BuildKit ===== | ||
| + | Might happen when using ansible' | ||
| + | |||
| + | ===== | ||
| + | Make sure that the files (app files, folders etc.) that the Dockerfile is suppose to copy are in the project root directory, where the Dockerfile file is (or docker compose file). Also check '' | ||
| + | |||
| + | ===== No internet access when building an image ===== | ||
| + | In an alpine image this might manifest for example (run inside the virtualbox VM) : | ||
| + | |||
| + | < | ||
| + | fatal: [10.21.21.11]: | ||
| + | msg: 'Error building my/ | ||
| + | , '' | ||
| + | tar.gz\n'', | ||
| + | r)\n\x1b[0m'', | ||
| + | ):\n required by: world[git]\n | ||
| + | |||
| + | </ | ||
| + | |||
| + | To test try adding ping in Dockerfile: | ||
| + | | ||
| + | ... | ||
| + | RUN ping -c 4 8.8.8.8 | ||
| + | ... | ||
| + | If you get a packet loss that means the docker can't access the Internet. Try first restarting the docker e.g. | ||
| + | |||
| + | systemctl restart docker | ||
| + | | ||
| + | If this doesn' | ||
| + | |||
| + | docker build --network host -t test1 -f Dockerfile . | ||
| + | |||
| + | In ansible task this looks like: | ||
| + | |||
| + | < | ||
| + | ... | ||
| + | - name: "Build the docker image" | ||
| + | docker_image: | ||
| + | name: "{{ full_app_name }}:{{ buildNo }}" | ||
| + | repository: "{{ full_app_name }}: | ||
| + | state: present | ||
| + | build: | ||
| + | path: "{{ deploy_helper.new_release_path }}" | ||
| + | network: host | ||
| + | force: "{{ not (disable_image_force_build | default(false)) }}" | ||
| + | ... | ||
| + | </ | ||
| + | ==== Tested on ==== | ||
| + | * Virtualbox VM Debian 11 Jessie (building inside of this VM) | ||
| + | * ansible 2.9.27 | ||
| + | * docker 24.0.7 | ||
| + | |||
| + | |||
| + | ===== Containers lose access to internet suddenly ===== | ||
| + | Try docker version downgrade. I had issues with version 5: | ||
| + | |||
| + | ==== Tested on ==== | ||
| + | * Debian 11 | ||
| + | |||
| + | ===== docker-compose down default_network error ===== | ||
| + | Try running compose down with exact same compose files as when the containers where created so if the containers were created like this: | ||
| + | |||
| + | # docker compose -f compose.database.yml -f compose.nats.yml -f compose.yml up -d | ||
| + | |||
| + | Run this: | ||
| + | |||
| + | # docker compose -f compose.database.yml -f compose.nats.yml -f compose.yml down | ||
| + | |||
| + | A simple '' | ||
| + | |||
| + | ===== network ... does not exist ===== | ||
| + | |||
| + | <code | download> | ||
| + | 'Error starting container 433f85f4bdf20d81c2f1c5ea5732e598d5ec0b7ea40e373d2e7a04fdff1b70d3: | ||
| + | 500 Server Error for http+docker:// | ||
| + | Internal Server Error (" | ||
| + | endpoint < | ||
| + | does not exist" | ||
| + | </ | ||
| + | |||
| + | Delete the network < | ||
| + | docker network rm < | ||
| ====== See also ====== | ====== See also ====== | ||
| Line 69: | Line 168: | ||
| ====== References ====== | ====== References ====== | ||
| * https:// | * https:// | ||
| + | * https:// | ||
wiki/docker_troubleshooting.1658230713.txt.gz · Last modified: by antisa
