4 Packaging applications from source code into Docker Images

Building Docker images is easy. In chapter 3 you learned that you just need a few instructions in a Dockerfile to package an application to run in a container. There’s one other thing you need to know to package your own applications: you can also run commands inside Dockerfiles.

Commands execute during the build, and any filesystem changes from the command are saved in the image layer. That makes Dockerfiles about the most flexible packaging format there is; you can expand zip files, run Windows installers, and do pretty much anything else. In this chapter you’ll use that flexibility to package applications from source code.

4.1 Who needs a build server when you have a Dockerfile? ...

Get Learn Docker in a Month of Lunches now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.