Container Control Panel
OliveTin is frequently used to create simple container control panels, this is one of the default examples that ships with the standard OliveTin config.yaml.
Setup if running inside a container
You can control other containers, when running OliveTin inside a container itself, however you need to do some extra setup when creating the OliveTin container.
If you want to control Docker from inside a Docker container, you will need to also create the container with --privileged . Podman does not have this requirement. If you are getting "permission denied" errors it is probably because OliveTin runs as user UID 1000 by default, which is not allowed by your docker host. Simply run OliveTin with --user root as a simple workround. Note that PUID and PGID variables will not work.
|
-
Pass
/var/run/docker.sock
as a bind mount to the container when creating it, eg:docker create --privileged --user root -v /var/run/docker.sock:/var/run/docker.sock ...additional args here...
Or, using the
docker run
syntax;docker run --privileged --user root -v /var/run/docker.sock:/var/run/docker.sock --name OliveTin jamesread/olivetin
-
The official x86_64 docker container comes with the
docker
client pre-installed. If you are usingarm
or andarm64
container, you will need to add Docker yourself.The reason that the arm
andarm64
containers do not include docker, is that when these images are cross-compiled at build time, it takes FOREVER because we have to emulate arm.
After you have passed the socket into the container (and optionally installed docker), you should be able to setup docker actions like it’s shown in the example above.
Entity file
To build this Container Control dashboard, we use an entity file that stores and updates produced by docker ps --format json > /etc/OliveTin/entities/containers.json
/etc/OliveTin/entities/containers.json
Unresolved include directive in modules/ROOT/pages/solutions/container-control-panel/index.adoc - include::config/containers.json[]
You can generate this file yourself the first time, but the config.yaml
below shows how OliveTin can run the docker ps
command on startup, and on a schedule to update the file.