Docker Useful Commands

docker-useful-commands

This article shows a curated list of docker commands that may be useful.

1. Inspect container and filter by its property

docker inspect -f '{{ .NetworkSettings.IPAddress }}' container_name

2. detached and interactive terminal

Run a nginx container in a detached interactive terminal that maps the host port 8088 to the nginx webserver port
and open a shell in the interactive terminal.

docker run -dit --name my-nginx -p 8088:80 nginx /bin/bash 

Enter the shell

docker attach my-nginx

Exit the shell while keeping the nginx running

Ctl+P, Ctl+Q

Comments

Popular posts from this blog

Distributed Transaction Management with REST and Try Confirm/Cancel Pattern

Spring JMS and JPA XA Transactions with WebLogic

Spring Data MongoDB GridFS 3.4