Link Search Menu Expand Document

Docker

This will be also about project connected to or running on Docker, like Portainer.

Docker software

A container run an image.
Data are in /var/lib/docker/volumes/.

Container management:

  • Run docker run -d --name container_name image with image nginx for example
  • Stop docker stop container_name
  • Restart docker restart container_name
  • Pause docker pause container_name and docker unpause container_name
  • Kill docker kill container_name
  • Remove docker rm container_name
  • Bash docker attach container_name

Images management:

  • List docker images
  • Remove docker rmi image_name
  • List of images are in the Docker Hub

Other commands:

  • Get Docker directory docker info
  • List all containers docker ps -a
  • Run a command in a container docker exec container_name command
  • Do some spring cleanup - (Be careful with that!) docker system prune --all

Portainer - Web container management

Helps to manage containers.

Run docker run --restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

Fix 0.0.0.0 IP in exposed port: change Public IP in Endpoints - Source

Watchtower - Automatic container update

Update containers automatically. Run the quick start script to install.

Environment variables:

  • TZ:timezone: Timezone
  • WATCHTOWER_SCHEDULE: 0 0 5 * * *: cron setting to check for update each day at 0500.

Chrony / Docker-NTP

Provide a NTP server.

  • 123:UDP need to be exposed