This is a fork of ydkn/docker-cups, which includes a script for persistent user management.
Usernames and passwords will persist across container restarts or rebuilds, as long as the /etc/cups directory exists outside the container (as a volume/bind mount).
If you run in to any trouble, please create an issue on GitHub.
I prefer/recommend docker compose:
services:
cups:
container_name: cups
hostname: cups
image: goosews/cups:latest
ports:
- "631:631"
environment:
- "TZ=America/New_York"
volumes:
- "/some/persistent/path/cups:/etc/cups"
- "/etc/localtime:/etc/localtime:ro"
devices:
- "/dev/bus/usb:/dev/bus/usb"
restart: unless-stopped
logging:
driver: json-file
options:
max-file: "3"
max-size: "10M"Login in to CUPS web interface on port 631 (e.g. https://localhost:631) and configure CUPS to your needs. Default credentials: admin / admin
You can add/remove/edit users and passwords via the user-management command. Once the container is running, you can utilize this with the command:
docker exec -it cups user-management