Alpine linux base image integrated with s6-overlay. Can be used as a base for other docker projects.
2.2K
The files contained within this branch docker/alpine-base are utilized as a foundation. This base image only provides us with a docker image which has alpine linux, Nginx, a few critical packages, and the s6-overlay plugin.
This branch docker/alpine-base does NOT contain any applications. It is only to be used as a base image which will be called when you build your docker app's 📄 Dockerfile.
For a more detailed set of documentation, view the Github repo and alpine branch at:
The information here is very truncated to conserve space.
This docker image includes the following features:
cont-init.d),
finalization (cont-finish.d) and their own services with dependencies between themPID 1 functionality
s6 and s6-portable-utils. Includes handy and composable utilities which make life much easier.logutil-service which uses s6-log under the hood.USER directive, to run your whole process tree as a specific user.To build a docker image using this base and the actual app you want to release, you need two different docker images:
📄 Dockerfile will grab and install the files from the branch docker/coreThese instructions outline how the alpine docker image is set up, and how to build your own docker image.
Prior to building the docker image, you must ensure the sections below are completed.
You must ensure when you build this docker image docker/alpine-base, the following conditions must be met.
If the listed tasks above are not performed, your docker container will throw the following errors when started:
Failed to open apk database: Permission denieds6-rc: warning: unable to start service init-adduser: command exited 127unable to exec /etc/s6-overlay/s6-rc.d/init-envfile/run: Permission denied/etc/s6-overlay/s6-rc.d/init-adduser/run: line 34: aetherxown: command not found/etc/s6-overlay/s6-rc.d/init-adduser/run: /usr/bin/aetherxown: cannot execute: required file not foundYou cannot utilize Windows' Carriage Return Line Feed. All files must be converted to Unix' Line Feed. This can be done with Visual Studio Code. OR; you can run the Linux terminal command 🗔 dos2unix to convert these files.
For the branches docker/alpine-base and your main app image, you can use the following recursive commands:
Caution
Be careful using the command to change **ALL** files. You should **NOT** change the files in your `📁 .git` folder, otherwise you will corrupt your git indexes.If you accidentally run
🗔 dos2unixon your📁 .gitfolder, do NOT push anything to git. Pull a new copy from the repo or reset your local files back to the remote:git reset --hard origin/main
# Change ALL files
find ./ -type f | grep -Ev '.git|*.jpg|*.jpeg|*.png' | xargs dos2unix --
# Change run / binaries
find ./ -type f -name 'run' | xargs dos2unix --
For the branch docker/core, you can use the following commands:
dos2unix docker-images.v3
dos2unix aetherxown.v1
dos2unix package-install.v1
dos2unix with-contenv.v1
+x / 0755 PermissionsThe files contained within this repo MUST have chmod 755 / +x executable permissions. If you are using our Github workflow sample deploy-docker-github.yml, this is done automatically. If you are building the images manually; you need to do this. Ensure those files have the correct permissions prior to building the Alpine base docker image.
If you are building the docker/alpine-base or your main application images, you must ensure the files in those branches have the proper permissions. All of the executable files are named run:
find ./ -name 'run' -exec sudo chmod +x {} \;
Optional - If you want to set the permissions manually, run the following below. If you executed the find command above, you don't need to run the list of commands below:
sudo chmod +x ./root/etc/s6-overlay/s6-rc.d/init-adduser/run \
./root/etc/s6-overlay/s6-rc.d/init-crontab-config/run \
./root/etc/s6-overlay/s6-rc.d/init-custom-files/run \
./root/etc/s6-overlay/s6-rc.d/init-envfile/run \
./root/etc/s6-overlay/s6-rc.d/init-folders/run \
./root/etc/s6-overlay/s6-rc.d/init-keygen/run \
./root/etc/s6-overlay/s6-rc.d/init-migrations/run \
./root/etc/s6-overlay/s6-rc.d/init-permissions/run \
./root/etc/s6-overlay/s6-rc.d/init-samples/run \
./root/etc/s6-overlay/s6-rc.d/init-version-checks/run \
./root/etc/s6-overlay/s6-rc.d/svc-cron/run \
./root/etc/s6-overlay/s6-rc.d/svc-php-fpm/run \
./root/etc/s6-overlay/s6-rc.d/svc-nginx/run \
./root/etc/s6-overlay/s6-rc.d/init-php/run \
./root/etc/s6-overlay/s6-rc.d/init-nginx/run
For the branch docker/core, there are a few files to change. The ending version number may change, but the commands to change the permissions are as follows:
sudo chmod +x docker-images.v3 \
chmod +x aetherxown.v1 \
chmod +x package-install.v1 \
chmod +x with-contenv.v1
After completing the steps above; we will now build the 🔆 docker/alpine-base image.
Creates the alpine amd64 docker image:
# Build alpine amd64
docker buildx build \
--build-arg ARCH=x86_64 \
--build-arg VERSION=3.22 \
--build-arg BUILDDATE=20260812 \
--build-arg RELEASE=stable \
--tag ghcr.io/aetherinox/alpine-base:latest \
--tag ghcr.io/aetherinox/alpine-base:3 \
--tag ghcr.io/aetherinox/alpine-base:3.2 \
--tag ghcr.io/aetherinox/alpine-base:3.22 \
--tag ghcr.io/aetherinox/alpine-base:3.22-amd64 \
--attest type=provenance,disabled=true \
--attest type=sbom,disabled=true \
--output type=docker \
--builder default \
--file Dockerfile \
--platform linux/amd64 \
--allow network.host \
--network host \
--no-cache \
--push \
.
Creates the alpine arm64 docker image:
# Build alpine arm64
docker buildx build \
--build-arg ARCH=aarch64 \
--build-arg VERSION=3.22 \
--build-arg BUILDDATE=20260812 \
--build-arg RELEASE=stable \
--tag ghcr.io/aetherinox/alpine-base:latest \
--tag ghcr.io/aetherinox/alpine-base:3 \
--tag ghcr.io/aetherinox/alpine-base:3.2 \
--tag ghcr.io/aetherinox/alpine-base:3.22 \
--tag ghcr.io/aetherinox/alpine-base:3.22-arm64 \
--attest type=sbom,disabled=true \
--output type=docker \
--builder default \
--file Dockerfile \
--platform linux/arm64 \
--allow network.host \
--network host \
--no-cache \
--push \
.
Note
If you want to only build the alpine docker image locally; remove `--push`.
After building the image, you can now call this base alpine image in your project's Dockerfile.
To utilize this image, open the Dockerfile for the project you wish to utilize this image as your base, and then add the following at the top:
ARG ARCH=amd64
ARG ALPINE_VERSION=3.22
# from Dockerhub
FROM --platform=linux/${ARCH} aetherinox/alpine-base:${ALPINE_VERSION}
# from Github
FROM --platform=linux/${ARCH} ghcr.io/aetherinox/alpine-base:${ALPINE_VERSION}
Content type
Image
Digest
sha256:1dbe9a72f…
Size
15.5 MB
Last updated
over 1 year ago
docker pull aetherinox/alpine-base