Sign inSign up

hexian000/alpine-s6

By hexian000

•Updated 5 months ago

Alpine Linux with s6-svscan as init.

Image
Operating systems
0

3.5K

hexian000/alpine-s6 repository overview

⁠alpine-s6

Alpine Linux base image with s6⁠ process supervision built in.

⁠Quick reference

  • Image: hexian000/alpine-s6
  • Base: Alpine Linux⁠
  • Platforms: linux/amd64, linux/arm64, linux/arm/v7

⁠Tags

TagBase
latest, 3.23Alpine 3.23
3.22Alpine 3.22
3.21Alpine 3.21
3.20Alpine 3.20
3.19Alpine 3.19
3.18Alpine 3.18

⁠What's included

  • s6 — process supervision suite
  • tzdata — timezone data
  • Custom /sbin/init entrypoint

⁠How it works

The /sbin/init entrypoint handles startup in this order:

  1. rc.local — if /etc/rc.local is executable, it is run first.
  2. One-shot command — if arguments are passed to the container, they are executed directly via sh.
  3. Service supervision — if /var/services/ exists:
    • writable mount → symlinked to /run/service (bind-mount your services directory)
    • read-only → copied into /run/service
    • absent → drops to an interactive shell
  4. s6-svscan is exec'd over /run/service.

⁠Usage

⁠Run a supervised service

Create a service directory with a run script:

myapp/
└── run        ← executable shell script
FROM hexian000/alpine-s6:latest

COPY myapp /var/services/myapp

Or mount the services directory at runtime:

docker run -v /host/services:/var/services hexian000/alpine-s6
⁠Run a one-shot command
docker run --rm hexian000/alpine-s6 /your-script.sh
⁠Run with rc.local initialization
FROM hexian000/alpine-s6:latest

COPY rc.local /etc/rc.local
RUN chmod +x /etc/rc.local

COPY myapp /var/services/myapp

⁠Service directory layout

/var/services/
└── myservice/
    ├── run          ← required: exec the long-running process
    └── finish       ← optional: cleanup on exit

Each run file must be an executable script that execs the service process (do not background it).

#!/bin/sh
exec /usr/bin/myapp --flag

⁠Timezone

tzdata is preinstalled. Set the timezone via the TZ environment variable:

docker run -e TZ=America/New_York hexian000/alpine-s6

Tag summary

Content type

Image

Digest

sha256:3d81afa91…

Size

4.2 MB

Last updated

5 months ago

docker pull hexian000/alpine-s6