Downloading docker
Downloading container:
$ sudo docker pull ubuntu
$ sudo docker pull ubuntu:14.04
14.04 is a tag from docker image repository, it can be found here.
Deleting docker container
$ sudo docker rmi [NAME/IMAGE ID]
$ sudo docker rmi ubuntu:14.04
$ sudo docker rmi 00fd29ccc6f1
Listing
Info about docker:
sudo docker info
List running and stopped containers, -a for all
Queuing
$ sudo docker search alpine --filter 'is-official=true'
$ sudo docker images --format '{{.Size}} {{.Repository}}'
Run docker container:
$ sudo docker run hello-world
Attaching to process:
$ sudo docker attachach [container-id]
Run and attach to it:
$ sudo docker run -it ubuntu /bin/bash
Running and binding port:
$ sudo docker run -p 90:90 -t [hash]
$ docker ps
$ docker exec -it e37f24dc7e0a bash
$ sudo docker stop 7d5bc3d73c1b # sends SIGTERM to PID1
Visi konteineriai saugomi:
# ls /var/lib/docker/containers/
$ sudo docker rmi 9f163cb3061e
Deleting Images
You cannot delete an image that is associated with a container in the running (Up) or stopped (Exited) states.
$ sudo docker images -q
$ sudo docker rmi 9f163cb3061e