-
Build image
docker build --tag=friendlyhello . -
Check for images
docker image ls -
Run image
docker run -p 4000:80 friendlyhelloNote: the
-pmaps the host's port 4000 to the container port 80. -
From host computer, via a browser window access Flask App on address
localhost:4000 -
Hit
CTRL+Cto quit in the terminal.
Alternatively:
-
Run image in detached mode:
docker run -d -p 4000:80 friendlyhello -
List containers that are running
docker ps. Look for theCONTAINER_IDthat is running. -
Stop container
docker container stop <CONTAINER_ID>