Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 642 Bytes

File metadata and controls

21 lines (11 loc) · 642 Bytes

First example of Docker with Python Flask app

  1. Build image docker build --tag=friendlyhello .

  2. Check for images docker image ls

  3. Run image docker run -p 4000:80 friendlyhello

    Note: the -p maps the host's port 4000 to the container port 80.

  4. From host computer, via a browser window access Flask App on address localhost:4000

  5. Hit CTRL+C to quit in the terminal.

Alternatively:

  1. Run image in detached mode: docker run -d -p 4000:80 friendlyhello

  2. List containers that are running docker ps. Look for the CONTAINER_ID that is running.

  3. Stop container docker container stop <CONTAINER_ID>