Sharing Images

Up until now, during development, we’ve been building our custom images on our local machine. Initially, we did this with this command:

 $ ​​docker​​ ​​build​​ ​​[OPTIONS]​​ ​​.

We quickly progressed to using Compose to build images for us—for example:

 $ ​​docker-compose​​ ​​build​​ ​​web

However, we have a problem. We’re going to need to run those same images we’ve been building locally on different machines as our app progresses through our build pipeline environments (such as testing, integration, staging, and production). How will we get our images onto the different machines?

One possibility is to rebuild the image on each machine that needs it, but this is wasteful and time-consuming. Images are more than just a convenient ...

Get Docker for Rails Developers 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.