Installing Docker under Linux (Ubuntu / Mint)

Download the latest version of docker here (pool/stable):
If you need to know the Ubuntu release name for a version, you can find it here:
Likewise for Linux Mint:
hello world
sudo docker run hello-world
uninstall docker
sudo apt remove docker docker-engine containerd runc

using docker

show general info
sudo docker info
show running containers
sudo docker ps
create and start new container
sudo docker run [image]
start an existing container
docker start [id]
open linux shell to container
sudo docker exec -it [container_id] bash
stop container (find container_id using docker ps)
sudo docker stop [container_id]
remove image
docker rm -f [name]
update docker image
sudo docker pull [image]
list volumes
docker volume ls
get info on volume
docker volume inspect [volume_name]
remove volume
docker volume rm [volume_name]

docker run (new container)

run interactive linux docker
sudo docker run -it ubuntu bash
interactive (pseudo-TTY)
automatically remove container and associated file system on exit
name a container
-- name [name]
assign an environment variable
-e [name]=[value]
launch in background (detached)
bind image port to host
-p 5432:5432
make port available to localhost only
mount persistent volume on image
-v [host_dir]:[image_dir]
start container every time docker starts

docker images


Postgres image

pull latest stable
docker pull postgres
pull specific version
docker pull postgres:[postgres_version]
run image
docker run --name postgres -e POSTGRES_PASSWORD=[password] -e POSTGRES_DB=[database_name] -p -v [persistent_dir]:/var/lib/postgresql/data  postgres
environment variables
POSTGRES_PASSWORD=super user password
POSTGRES_USER=super user name
POSTGRES_DB=default database, defaults to [POSTGRES_USER]