Created to manage a local Docker install for a home server. Current supports:
- Listing of current containers
- Starting, stopped and restarting containers
- Viewing docker system info
- View, automatically refresh and filter container logs
- View container properties
- 2 new monitor types for System and server status - 'Docker Up' & 'Docker Container Up'
Currently translated to English, Italian and Polish. UI is responsive across all device sizes.
If you're after a full Docker web interface you should consider https://www.portainer.io or https://yacht.sh.
It uses the Docker CLI and abuses the --format {{}}
arg for output parsing. This should work for normal installs of Docker and Rootless Docker installs where the webmin user has an appropriate Docker context and permissions applied (see Rootless Docker).
For monitors checks, docker info
is used to get the current Docker status to avoid complexities in determining how Docker is set to startup and run. Container health is checked via docker container inspect
.
The fastest way to install is to follow the "Http URL" method (https://webmin.com/docs/modules/webmin-configuration/#installing) and use the latest release package using https://github.com/dave-lang/webmin-docker/releases/latest/download/docker.wbm.gz.
Alternatively you can download and install it directly from the releases page or it build manually, the packaging steps are in the GitHub action in the repo.
Once installed:
- 'View docker containers' will appear in the menu under 'Servers'
- If you are using an alternative context for Docker, set this under the module configuration link in the top left of "View docker containers"
- 'Docker Up' & 'Docker Container Up' will appear in the monitors that can be configured under 'Tools' > 'System and server status'
Experimental rootless docker support has been added via docker contexts. To use this module with rootless docker:
- Ensure you have a context setup, you can do this via:
- Open a terminal as the user rootless dockerd runs as
- Run
id -u
to check the current user id - Check the docker.sock file path matches the user id, you can see the running service using
ps -al
- Run
docker context create rootless --docker "host=unix:///run/user/$(id -u)/docker.sock"
- If you want to always use this context, run
docker context use rootless
- If you didn't change the docker context via command:
- Once created, in the module screen click either 'Module config' or the cog icon to the left of the header
- Set the context override to match your new context, e.g.
rootless
Container listing/actions
Container inspection and logs
Host docker information
Monitors
Improvements or fixes are welcome, please raise it under issues and link to your branch.
Docker configuration has been setup to allow easier development.
The development environment creates 2 containers:
- webmin_master - Webmin on focal ubuntu with docker & webmin auto start, available on port 10000 on the host
- docker_dd - DIND container with rootless docker and webmin, available on port 20000 on the host (DOES NOT AUTO START). Very hacky.
cd tools
docker-compose up -d
to run docker compose as daemon- Open http://localhost:10000 to access the webmin console for docker on Ubuntu
- If you want to test rootless docker, run
docker exec -it --user root:root docker_dd /etc/webmin/start
- Open http://localhost:20000 to access the webmin console for rootless docker
- Login on both envs is
root
+password
, this can be adjusted in the Dockerfile - The config file will not automatically be loaded due to locking issues, you will need to run:
docker exec -it --user root:root webmin_master sh -c 'cp /usr/share/webmin/docker/config /etc/webmin/docker'
docker exec -it --user root:root docker_dd sh -c 'cp /usr/local/webmin/docker/config /etc/webmin/docker'
To burn and recreate the environment use docker-compose down -v
This environment has Webmin and Docker already installed, along with a very basic docker config ready to start in the container (Docker in Docker in Docker?).
The plugin is installed in the Webmin environment via shared folder, changes will appear immediately. This is done via:
- Sharing the ./docker directory into webmin directory using Docker volume (see docker-compose.yml)
- Adding the ACL permission for the module via the Dockerfile
Use docker exec -it webmin_master /bin/bash
to get a SSH console.
Start the internal container via:
cd dind
docker-compose up -d
Hacky webmin on DIND rootless container to allow for rootless docker testing. Webmin doesn't auto start, you will need to open a terminal and:
docker exec -it --user root:root docker_dd /etc/webmin/start
- To setup a docker context for testing:
docker exec -it docker_dd /bin/sh
docker context create rootless --docker "host=unix:///run/user/$(id -u)/docker.sock"
- In the webmin module conf, change to use the rootless context or run
docker context use rootless
To start a test container
cd /home/dind
docker-compose --context rootless up -d
Use docker exec -it docker_dd /bin/sh
to get a console.