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 [2025/04/10 12:25] (current) – [Containers lose access to internet suddenly] update docker version 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 | ||
====== See also ====== | ====== See also ====== | ||
Line 69: | Line 144: | ||
====== References ====== | ====== References ====== | ||
* https:// | * https:// | ||
+ | * https:// | ||
wiki/docker_troubleshooting.1658230713.txt.gz · Last modified: 2022/07/19 11:38 by antisa