Remember to also install docker-compose.
sudo pacman -S docker-compose
IPVlan - Macvlan Networks
For some reason, running IPVlan networks on the NetworkManager daemon doesn't work. I disabled the NetworkManager and enabled systemd-networkd. Then ran:
docker network create -d ipvlan --subnet=<your subnet> --gateway=<your gateway> -o parent=<ethernet interface> my_ipvlan_name
To mount a container to that network through compose, you need to add it in the compose file as (alpine is used for the example):
service: alpine: image: alpine container_name: alpine networks: ipvlan: ip4_address: 192.168.0.4 # This is the IP assigned to the container. If not included, it will grab the first available IP from the DHCP server restart: unless-stopped ports: - 80:80 networks: ipvlan: external: true
Cool Commands
A live resource monitor for docker containers:
docker stats
Find the locations of all docker containers running through compose:
docker compose ls
List all docker containers:
docker ps
Go inside a container through shell:
docker exec -it <container name> <entrypoint>
The entrypoint is basically telling the container which shell to open when entering. For most cases, it will be:
/bin/bash /bin/zsh bash zsh
Restart and recreate a container stack:
docker compose up -d --force-recreate