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 [2023/09/15 13:02] – add failed to compute cache key antisa | wiki:docker_troubleshooting [2025/04/10 12:25] (current) – [Containers lose access to internet suddenly] update docker version antisa | ||
---|---|---|---|
Line 85: | Line 85: | ||
===== | ===== | ||
- | 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). | + | 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). |
+ | |||
+ | ===== 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 ====== |
wiki/docker_troubleshooting.1694782973.txt.gz · Last modified: 2023/09/15 13:02 by antisa