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.
Writing Dockerfiles
From the course: Introduction to Docker for Java Developers
Writing Dockerfiles
- Now let's learn how to build an image. The primary tools for standing up a Docker image is with a Dockerfile and the Docker build command. Let's learn about Dockerfiles first. A Dockerfile is basically an image recipe card. It begins with a From base image and ends with a CMD or entrypoint command. From provides the builder a starting state, followed by more of the following, add and copy commands contribute files from the local file system into the image. Additional Froms are for creating multi-stage builds. Run executes a shell command within the image. User claims a user permissions for proceeding instructions. Volume is used to associate a folder in a container with external data. Workdir changes the current working directory. And CMD or entrypoint is the final command which usually launches the containerized application. There's a lot more instructions that are available, but these are just some of the basic ones…
Contents
-
-
-
-
Understanding containerization2m 9s
-
(Locked)
Comparing images to containers1m 43s
-
(Locked)
Writing Dockerfiles1m 8s
-
(Locked)
Discover the Docker CLI1m 52s
-
(Locked)
Learn Dockerfile instructions7m 24s
-
(Locked)
Convert code to a Docker image4m 51s
-
(Locked)
Challenge: Modify Dockerfile to remove Forever.java45s
-
(Locked)
Solution: Modify Dockerfile to remove Forever.java1m 10s
-
-
-
-