This is the base of all my linux VM installs I use for docker etc
- Download netinst ISO from debian website
- Create a VM on your hypervsor
- VM Machine Spec:
- 200GB
- 2 CPU
- 4GB RAM
- Attach to external network
This is the easiest way to install docker and docker compose on debian.
Better yet docker updates can be done by rerunning the script mentioned or using apt upgrade etc
Assumes you followed Debian VM Install Instructions
Login as yourself
curl -fsSL https://get.docker.com -o get-docker.sh
i like using docker swarm for home labs
assumes you installed docker like this
sudo docker swarm init
it will produced output something like this
This is how to install portainer on the swarm you created using this gist note this should work on non-swarm installs too!
Download the portain stack yaml that will do this for you
curl -L https://downloads.portainer.io/ce2-17/portainer-agent-stack.yml -o portainer-agent-stack.yml
This assumes you have installed a docker swarm
When one has a docker swarm a container running on any node in the swarm can be accesed using any IP address of any swarm memeber.
For example if you had a single web server running on port 80, on one node of a swarm you could access the web server with any of the following IP addresses:
This (and related gists) captures how i created my docker swarm architecture. This is intended mostly for my own notes incase i need to re-creeate anything later! As such expect some typos and possibly even an error...
Each major task has its own gist, this is to help with maitainability long term.
Assumes you installed debian, docker, etc as per the list here
glusterfs-vol1
This template runs my ouath2-proxy for azure auth for web sites that don't have any native auth mechansim.
none, this container can be cofigured entirely by env vars so i use those
none, this published default port of 4180 for this container, it can be reached by swarmIP:4180
This template runs my experimental NPM service as part of evaluating if i should stop using my hand crafted nginx reverse proxy. Note change your passwords and don't use the examples bellow :-) )
This container has a database, as such I store the data on the gluster volume. I am currenlty using a mount point to store the voume data on glusterfs. I restrict to 1 instance of each container to avoid database corruption from having two instances. Change example usernames and passwords as needed. leave hostname as db (name resolution works fine using the method)
This template runs mqtt for use with home automation
With the latest version of mosquitto a single config is required to enable it to listen. You can do this by mapping thevconfig in a volume mount as per normal. However in this version i have implemented configs as these are available to the whole swarm
none, this published default port of 1883 (if you need port 9001 then you already know why and how to modify this example :-) )