From the course: Docker: Build and Optimize Docker Images
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Using basic debugging techniques - Docker Tutorial
From the course: Docker: Build and Optimize Docker Images
Using basic debugging techniques
- [Instructor] We've already talked about some of the common errors you may encounter when working with docker images, but what if you get an error that you don't understand? In this video, we'll cover some basic debugging techniques to get you back on track. Think of docker's output as a map. Every line points you closer to the working image. You can run your build with plain logs by using the command docker build --progress=plain. This allows you to catch every detail. Look for red flags, including syntax errors in your docker file, missing environment variables, or permission errors. When you're working with multi-stage builds, you can isolate the build stage that is causing errors. You can do this in the docker build command using the --target option and then the name of the build stage you want to troubleshoot. Here I'm targeting the builder stage. I could also target the production stage if I don't find any errors in the builder stage. By confirming whether the hiccup is in your…