Docker - Quick look on run process in django


 


1) Run a container from the Alpine version 3.9 image, name the running container “web” and expose port 5000 externally, mapped to port 80 inside the container. 

   docker container run --name web -p 

   5000:80 alpine:3.9


2) Stop a running container through SIGTERM 

   docker container stop web


3) Stop a running container through SIGKILL 

   docker container kill web


4) List the networks 

   docker network ls 


5) List the running containers (add --all to include stopped containers) 

   docker container ls 


6) Delete all running and stopped containers 

   docker container rm -f $(docker ps -aq) 


7) Print the last 100 lines of a container’s logs 

   docker container 

   logs --tail 100 web

Comments