Publishing Docker images using Docker Compose

In earlier chapters, you learned how to use Docker Compose to help simplify the number of CLI commands required to test and build your Docker images. At the moment, Docker Compose is only building Docker images locally, but of course you now want to be able to publish your Docker images and leverage your Docker Compose workflow.

Docker Compose includes a service configuration property called image, which is commonly used to specify the image of a container that you would like to run:

version: '2.4'services:  web:    image: nginx
Example Docker Compose file

Although this is a very common usage pattern for Docker Compose, another configuration and set of behaviors exist if you combine both the build ...

Get Docker on Amazon Web Services 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.