QuestionQ333

Application Deployment and Security

Drag the steps from the left into the order shown on the right to build and run a customized Python Docker image. Not every option will be used.

Drag & Drop
Create a Dockerfile that contains the text: FROM python:3.7.2 COPY ./my_app.py /app
Create a Dockerfile that contains the text: IMPORT python:3.7.2 COPY ./my_app.py /app
$ docker run -dit --name my-running-app -p 8080:80 my-app
$ docker compile -t my-app .
$ docker build -t my-app .
step 1
step 2
step 3
Explanation

A Dockerfile starts from a base image using FROM, and COPY places the application file into the image. docker build -t my-app . builds and tags that image from the current build context. docker run then creates and starts a container using the resulting my-app image, with the specified name and port mapping.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!