Extending another container with FROM

Similar to our last container, our FROM nginx:latest line ensures that we are using the latest version of a base image, but instead of Ubuntu, here, we will use NGINX as our base. The latest ensures that we get the image with the latest features and often patches too at a slight risk of breakages and API incompatibility in the future.

When writing your Docker containers, you will often have to make these trade-off decisions based on your situation and stability requirements, but the NGINX API has been very stable for years now, so in this specific case, we do not need the stability that the named tags provide. If we wanted one of those tagged versions here, latest would just change to the version we wanted that is offered on Docker Hub, which we can find at https://hub.docker.com/_/nginx/ , so something like FROM nginx:1.13 would have been perfectly fine too.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset