title: “docker commands”
date: 2016-03-24T12:52:14
slug: docker-commands
Show running docker instances with ID
docker ps
Show running docker instances with ID (History)
docker ps -a
Show the last running container
docker ps -l
Start an Docker Instance (from ‘docker ps -a’)
docker run 4dcecf77c564
Committing a docker instance:
docker commit a589d9df44ec coreos/apache
while a589d9df44ec is the ID listed with “docker ps” Stop docker instance
docker stop 4ecbf72df071
Alle Container löschen
docker rm `docker ps -qa`
Einen Befehl in einem Container ausführen
docker exec -it db bash
List Images
docker images
stdout eines Containers anzeigen
docker logs 9f5aafa2536b
Ports eines Containers anzeigen
docker port 1a109a55a86d
Prozesse in einem Container anzeigen
docker top
Statusinformationen eines Containers anzeigen
docker inspect 1a109a55a86d
Remove a Container from the bridge
docker network disconnect bridge <containername>
Create an own bridged network
docker network create -d bridge my-bridge-network
List Networks
docker network ls
Details/Inspect a network
docker network inspect my-bridge-network
Attach network to a container
docker network connect my-bridge-network web
Attach Data Volume to a container
docker run --name ubuntu -v /webmount -it ubuntu /bin/bash
Attach Host Directory to a container
docker run --name ubuntu -v /home/webapp:/webmount -it ubuntu /bin/bash
d
