The Whole Shebang: Compose Files

<p>I have recently been&nbsp;<a href="https://medium.com/@cristovaocordeiro" rel="noopener">writing</a>&nbsp;and&nbsp;<a href="https://www.udemy.com/course/docker-crash-course-learn-from-experience-for-beginners/?referralCode=BAC861F284EACA8695FD" rel="noopener ugc nofollow" target="_blank">teaching</a>&nbsp;a lot about Docker and containers in general. I&rsquo;m very appreciative of those of you who consume my content and provide feedback. I hear you and naturally, the next topic to be tackled is Docker Compose &mdash; because since now you know how to build your own container images and run them, the next logical milestone is to create complex multi-container applications and manage all that as a single piece of software.</p> <h1>Docker Compose: What is it and Why do I need it?</h1> <blockquote> <p><strong>Compose</strong>&nbsp;is a tool for defining and running multi-container&nbsp;<strong>Docker</strong>&nbsp;applications.</p> </blockquote> <p>You can read more about it from the&nbsp;<a href="https://docs.docker.com/compose/" rel="noopener ugc nofollow" target="_blank">official docs</a>, but to simplify, consider the following: you use&nbsp;<strong>Docker</strong>&nbsp;to manage containers, images, volumes, etc. When you do&nbsp;<code>docker run</code>&nbsp;you are basically executing a&nbsp;<strong>single</strong>&nbsp;container. If you want to start a second container, that somehow interacts with the first one, you&rsquo;ll need to run&nbsp;<code>docker run</code>&nbsp;again, and take care of their volumes and networks separately, such that they can see and communicate with each other.</p> <p>Docker Compose abstracts all of this, by providing a&nbsp;<strong>wrapper</strong>&nbsp;on top of Docker (yes! Docker Compose is simply a high-level CLI for Docker). In fact, you&rsquo;ll see that most options are named in a very similar way to the ones available in the&nbsp;<code>docker run</code>&nbsp;subcommand.</p> <p><a href="https://betterprogramming.pub/the-whole-shebang-compose-files-5b6f50dd196c">Click Here</a></p>
Tags: Docker Shebang