Search notes:

Docker containers

Identifiying containers

A container is identified by an id that looks like ada3b521615d. Additionally, a container is given a random(?) name like adoring_babbage or nifty_cray.

Status of containers

The possible states of containers are

Exporting a container's file system

The file system of a container can be exported to a tar archive with docker export.

Removing old Docker containers

$ docker rm $(docker ps -q -f status=exited)
$ docker rm $(docker ps --no-trunc -aq)
With Docker 1.13.x:
$ docker container prune
See also the --rm option of docker run (which removes the a container right after executing the command in it).

Detaching and attaching again

$ docker run -it --name foo debian bash
root@aa4a579e2648:/# var=hello
<ctrl-p> <ctrl-q>
Container is detached.
Attach again:
$docker attach foo
root@aa4a579e2648:/# echo $var

See also

docker run creates a container and runs a command in it.
docker ps lists containers.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759375216, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/tools/Docker/container(87): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78