dev-resources.site
for different kinds of informations.
Simple steps to debug docker build
Published at
11/6/2024
Categories
docker
build
debug
troubleshoot
Author
Le Vuong
Below are steps to debug docker build. In this example, docker is a python app, but the same logic apply to other languages and frameworks.
- In the Dockerfile, comment the lines that cause the build to fail and all other lines below that; Then add below line to the end of the Dockerfile.
CMD ["bash"]
Build again (this time it should success) and start the container.
docker run <image name>
Connect to the container:
docker exec -it <container> bash
Run the steps that cause the build error (in Dockerfile).
Eg.pip install -s requirements.txt
Investigate and try to fix the failed commands.
Continue with next other commands in the Dockerfile until everything is ok.
When finished, uncomment the commented lines in Dockerfile in step 1.
Try and build Dockerfile again.
References:
- How to build docker
- How to dockerize an app
Articles
12 articles in total
Python C/C++ binding - Some notes
read article
Lodash - a javascript power tool
read article
10 questions developers should ask our self
read article
Simple steps to debug docker build
currently reading
Script for converting Markdown with bold text to Unicode, retaining the bold text.
read article
Quick mongo tutorial
read article
Event driven architecture challenge: message ordering
read article
What I Learned from Reading Clean Code
read article
Browser request interceptor
read article
Ubuntu hibernate
read article
Repair grub Linux/Windows dual boot
read article
Code visualization tools
read article
Featured ones: