Docker Commands

By James Kenny
1 min read

Table of Contents

As I dig deeper and deeper into Docker. I'm finding some really useful commands that I have to keep using and reusing. As I use and learn more I will add to this guide.

Docker build command

docker build -t webapp .

Docker Tag and Push

docker tag webapp *.azurecr.io/webapp
docker push *.azurecr.io/webapp

Docker container management

Pull the latest image

docker pull *.azurecr.io/webapp

Run Container

docker run --name webapp -d -p 8090:80 *.azurecr.io/webapp

Run a container with a name of webapp, expose port 8090 and route to port 80 on the container.

Running containers

docker ps

Stop container

docker stop a456721

Remove container

docker rm a456721

This can only be run on stopped containers.

Tagged in:

Docker

Last Update: September 24, 2018

About the Author