Skip to content

Docker

Introduction

Docker host is a VM on trueNAS scale running ubuntu server. Docker is installed by snap but thinking better to do traditional install next time.

VM CPU is 1 -2 - 4

Network card is bridged to metal ethernet port with VirtIO drivers

Initial Install

ubuntu server install with ssh
ssh copy-id xxxxx@x.x.x
install docker as per https://docs.docker.com/engine/install/ubuntu/
post-installation https://docs.docker.com/engine/install/linux-postinstall/
apt install nfs-utils

Container setup

Warning

Make directories for traefik, portainer and bookstack (for database as it plays badly with NFS).

Then in order create:

  1. Traefik: docker compose file with local volume for config
  2. Portainer: docker compose with nfs share for config
  3. Homepage: docker compose in portainer
  4. Bookstack: docker compose, volume for bookstack NFS, for mariadb in local folder

Docker Tips

docker-compose build
docker-compose up -d

And when you've had enough

docker-compose down

The core concepts here are to build custom images then activate (containerise) them.

15 Most Useful Docker Commands

docker -version
docker pull
docker run
docker ps
docker ps -a
docker exec
docker stop
docker kill
docker commit
docker login
docker push
docker images
docker rm
docker rmi
docker build

Docker Networks

A user defined docker network has automatic discovery of other containers in the network, so they can be referenced by container name rather than IP, as this will often change each time the containers are created.

Docker Schema

Basic structure of a docker setup