From the course: Docker Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Solution: Build and run your first image

Solution: Build and run your first image - Docker Tutorial

From the course: Docker Essential Training

Solution: Build and run your first image

(Upbeat electronic music) - [Instructor] Okay, let's solve the challenge. I hope you found this fun and educational. Let's open this docker file in an editor so that we can fix it. So you should have noticed that the Docker file already have four commands built-in, from Golang:1.18, WORKDIR /app, and then this run statement over here. And then this entry point. If we try to build this as is, we'll get an error that looks kind of like this. While we get an error about a go.mod file that's missing, the challenge prompt said that we didn't need to know any Golang to fix this. So, how do we fix this without knowing Golang? Perhaps we should copy the contents of this directory into our image? Let's try that. Let's go back into our Docker file. And from here I'm going to go ahead and add the copy command. Now where we put this command is important. If we put it after the run statement, then the layer that this command runs…

Contents