From the course: Introduction to Docker for Java Developers

Unlock the full course today

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

Solution: Modify Dockerfile to remove Forever.java

Solution: Modify Dockerfile to remove Forever.java

From the course: Introduction to Docker for Java Developers

Solution: Modify Dockerfile to remove Forever.java

(bright music) - [Instructor] Okay, so how do you do this? How do you figure this problem out? So after we've called the javac command, we don't need this Forever.java anymore. So we will say RUN rm Forever.java. And now let's build that image again with build -t foreverbuilder -f Dockerfile-build.. So I compiled it, it says it removed it. And now let's run this image as a container. So we're running it in detached mode again. So it runs it in the background so we can inspect it with the exec command. So there's a few different things you could do here. I'm just going to run the exec to start a shell and see what directory I'm in. I'm already in the app folder, do an ls, and the Forever.java class is not there. Did you do it? I knew you could.

Contents