A lightweight Docker image based on Ubuntu 22.04 with Supervisor process manager for running multiple services in a single container.
Maintainer: Przemyslaw (Ozzy) Ozgo
/data volume# Run in detached mode
docker run -d -p 9111:9111 -v /host/data:/data polinux/supervisor-ubuntu22
# Run interactively
docker run -it -p 9111:9111 -v /host/data:/data polinux/supervisor-ubuntu22
| Variable | Default | Description |
|---|---|---|
SUPERVISOR_USERNAME | sv | Username for supervisor web interface |
SUPERVISOR_PASSWORD | password | Password for supervisor web interface (runtime default) |
SUPERVISOR_USER | supervisor | Non-root user for running supervisor |
SUPERVISOR_UID | 1000 | User ID for supervisor user |
SUPERVISOR_GID | 1000 | Group ID for supervisor user |
SUPERVISOR_VERSION | 4.2.5 | Supervisor version (build-time) |
docker run -d \
-e SUPERVISOR_USERNAME=admin \
-e SUPERVISOR_PASSWORD=secure123 \
-p 9111:9111 \
-v /host/data:/data \
polinux/supervisor-ubuntu22
/
├── config/
│ ├── bootstrap.sh # Container entry point
│ └── init/ # Custom initialization scripts
├── etc/
│ ├── supervisord.conf # Main supervisor configuration
│ └── supervisor.d/ # Service configuration directory
└── data/ # Persistent data volume
├── conf/ # Configuration files
├── logs/ # Log files
└── run/ # Runtime files (PIDs, sockets)
Create .conf files in /etc/supervisor.d/ to define services:
[program:myservice]
command=/usr/bin/myservice
directory=/opt/myservice
autostart=true
autorestart=true
user=www-data
stdout_logfile=/data/logs/myservice.log
stderr_logfile=/data/logs/myservice_error.log
Place custom initialization scripts in /config/init/ with .sh extension. These run before supervisor starts:
#!/bin/bash
# /config/init/01-setup.sh
echo "Setting up application..."
# Your initialization code here
The /data volume should be mounted for persistent storage:
/data/conf - Configuration files/data/logs - Application and supervisor logs/data/run - Runtime files (PIDs, sockets)Access the Supervisor web interface at http://localhost:9111 using the configured credentials.
Features:
| Port | Service |
|---|---|
| 9111 | Supervisor web interface |
Image Optimizations:
Security Features:
docker run -it \
-p 9111:9111 \
-v $(pwd)/config:/config/init \
-v $(pwd)/data:/data \
polinux/supervisor-ubuntu22
docker run -d \
--name supervisor-container \
--restart unless-stopped \
-e SUPERVISOR_USERNAME=admin \
-e SUPERVISOR_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) \
-p 127.0.0.1:9111:9111 \
-v /opt/data:/data \
-v /opt/services:/etc/supervisor.d \
polinux/supervisor-ubuntu22
Permission Denied
/data volume has correct permissionsServices Not Starting
/data/logs/supervisord.log/etc/supervisor.d/Web Interface Access
# Check supervisor status
docker exec container-name supervisorctl status
# View logs
docker exec container-name tail -f /data/logs/supervisord.log
# Interactive shell
docker exec -it container-name /bin/bash
Create a docker-compose.yml file:
version: '3.8'
services:
supervisor:
image: polinux/supervisor-ubuntu22
container_name: supervisor-container
restart: unless-stopped
ports:
- "9111:9111"
environment:
- SUPERVISOR_USERNAME=admin
- SUPERVISOR_PASSWORD=secure123
- SUPERVISOR_UID=1000
- SUPERVISOR_GID=1000
volumes:
- ./data:/data
- ./services:/etc/supervisor.d
- ./init:/config/init
networks:
- supervisor-net
networks:
supervisor-net:
driver: bridge
Run with:
docker-compose up -d
This repository uses GitHub Actions for automated building, testing, and deployment.
main or dev branchesTo enable Docker Hub deployment, configure these secrets in your GitHub repository:
| Secret | Description |
|---|---|
DOCKERHUB_USERNAME | Your Docker Hub username |
DOCKERHUB_TOKEN | Docker Hub access token (not password) |
The image is built for multiple architectures:
linux/amd64 (Intel/AMD 64-bit)linux/arm64 (ARM 64-bit)MIT License - see LICENSE file for details.
Author: Przemyslaw (Ozzy) Ozgo
Content type
Image
Digest
sha256:7b92e1a64…
Size
44.6 MB
Last updated
about 1 year ago
docker pull polinux/supervisor-ubuntu22