Docker

Docker Commands

Command to inspect the content of an image created

docker run -it --name temp_container imageName /bin/sh

where "temp_container" is the name of temporary container

docker images

to list images

docker build -t server .

to build images where "server' is the name of image

docker run --rm -p 8000:8000 name_of_image

Add --rm to remove the container after it stops

Command to get ip address of contaier

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres-local

Last updated

Was this helpful?