Summary of Docker commands that I often use but can't remember

I often use it, but for some reason I forget it soon (personal opinion) This is a copy / paste record of the docker command.

Start container by specifying port

i is standard input, t is tty assignment, d is background execution option

docker run -it --name <Container name> -d -p 80:80 <Image name>

Get the IP address of the container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <Container name>

Check the status of the container

I use it to see the volume mount status of a 90% container, but I'm sure there is an option to check only the mount. (Grep it because it's troublesome to check)

docker inspect <Container name>

Bulk container deletion

It is convenient to change the contents of $ () and substitute it (but forget it soon)

docker rm $(docker ps -aq)

Image of existing container

Useful for isolating when container startup fails.

docker commit <Container ID> <Arbitrary image name>

Recommended Posts

Summary of Docker commands that I often use but can't remember
List of Docker commands that I often use (container operation)
Summary of frequently used Docker commands
[Github] Summary of commands often used during development
Summary of frequently used commands in Rails and Docker
How to use Maven that I can't hear anymore
Summary of problems that I could not log in to firebase