Building and running the release image

Now that we have completed the configuration of the release stage of the Dockerfile, it's time to build our new released image and verify we can actually run our application successfully.

To build the image, we can use the docker build command, and because the release stage is the last stage of the Dockerfile, you don't need to target a specific stage, as we did previously for the test stage:

> docker build -t todobackend-release .Sending build context to Docker daemon 312.8kBStep 1/22 : FROM alpine AS test ---> 3fd9065eaf02......Step 13/22 : FROM alpine ---> 3fd9065eaf02Step 14/22 : LABEL application=todobackend ---> Using cache ---> afdd1dee07d7Step 15/22 : RUN apk add --no-cache python3 mariadb-client ...

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.