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 *
docker push *

Docker container management

Pull the latest image

docker pull *

Run Container

docker run --name webapp -d -p 8090:80 *

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:


Last Update: September 24, 2018

About the Author