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/13 09:39] – add --chmod option requires BuildKit antisa | wiki:docker_troubleshooting [2025/04/10 12:25] (current) – [Containers lose access to internet suddenly] update docker version antisa | ||
---|---|---|---|
Line 83: | Line 83: | ||
===== --chmod option requires BuildKit ===== | ===== --chmod option requires BuildKit ===== | ||
Might happen when using ansible' | 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 ====== |
wiki/docker_troubleshooting.1694597942.txt.gz · Last modified: 2023/09/13 09:39 by antisa