Sign inSign up

kgrv/alpine

By kgrv

Updated about 1 month ago

An Alpine Linux image with init, user, and mimalloc.

Image
Operating systems
0

10K+

kgrv/alpine repository overview

DESCRIPTION

An alpine image with init, user, and mimalloc based on kgrv/mini.

SUPPORTED TAGS

SUPPORTED ARCHITECTURES

OS/ARCHDescription
linux/amd6464-bit x86 architecture for Linux operating systems
linux/arm6464-bit ARM architecture for Linux operating systems

PARAMETERS

TypeContainerFunction
EnvironmentEUIDOptional Effective User ID
EnvironmentEGIDOptional Effective Group ID
EnvironmentUMASKOptional Default permissions
EnvironmentSUGGESTOptional Set suggestion messages
EnvironmentFALLBACK_CMDOptional Set command when empty
Volume/mntOptional Bind mount volume

OVERVIEW

Dockerfile

KeywordConfiguration
SHELL[ "/bin/ash", "-euxo", "pipefail", "-c" ]
ENVPATH_APP=/app
ENVPATH_CONFIG=/config
ENVPATH_DATA=/data
ENVPATH_HOME=/mini
ENVPATH_MNT=/mnt
ENVLD_LIBRARY_PATH=/app/lib:/usr/local/lib
ENVPATH=/app/bin:${PATH}
ENVXDG_CONFIG_HOME=/config
ENVXDG_DATA_HOME=/data
ENVHOME=/mini
ENVUSER=mini
WORKDIR${PATH_MNT} -> /mnt
ENVLD_PRELOAD=/usr/lib/libmimalloc.so
ENTRYPOINT[ "tini", "--", "enpt" ]

User / Group ID

  • EUID / EGID environment variables
  • mini:mini as default

Mask

  • UMASK defaults to 0022

Suggestion

  • SUGGEST defaults to true

Package Management

  • apk permitted for mini with doas

USAGE

Dockerfile

FROM kgrv/alpine
Init / Principle of Least Privilege
  • Utilize tini by using CMD without overriding ENTRYPOINT
FROM kgrv/alpine AS develop
...
CMD [ "nreq", "--debug" ]
  • Override ENTRYPOINT with "tini", "--", "enpt"
FROM kgrv/alpine AS develop
...
ENTRYPOINT [ "tini", "--", "enpt", "nreq" ]
CMD [ "--debug" ]

Application Init/Entrypoint Script

enpt loads the first ash script found in the following orders:

  • /app/init.sh
  • /app/docker-entrypoint.sh

Time Zone

  • Mount system /etc/localtime or /usr/share/zoneinfo
docker run -it -v /etc/localtime:/etc/localtime:ro kgrv/alpine
docker run -it -v /usr/share/zoneinfo/US/Eastern:/etc/localtime:ro kgrv/alpine

Docker CLI

docker run -it kgrv/alpine
Start container with bind mount
docker run -it -v $(pwd):/mnt kgrv/alpine
Start container with UID / GID

Important

Argument --user is not supported, please use EUID/EGID.

docker run -it -e EUID=$(id -u) -e EGID=$(id -g) kgrv/alpine
Start container as ROOT
docker run -it kgrv/alpine --BECOME_ROOT
Install packages
doas apk add PACKAGE

Custom Commands

arcm
  • Map different architecture keywords for CI/CD
    A script to map different architecture keywords.

    USAGE: arcm ARCH

    ARGUMENTS:
        ARCH    returns ARCH when no match:
                    aarch64, arm64, x86_64, amd64
                    amd64-n, amd64-x

    RETURNS:
        arm64   <->  aarch64
        amd64   <->  x86_64
        amd64-n  ->  x64
        amd64-x  ->  x86_64
  • Particularly helpful in Dockerfile
...
RUN ARCH="$(arcm ${TARGETARCH})" && \
    wget -nv "https://static.rust-lang.org/rustup/dist/${ARCH}-unknown-linux-musl/rustup-init" && \
...
enpt

Important

Ensure that root (0) user is executing the command.

  • Entrypoint script to be used in Dockerfile
FROM kgrv/mini:sh AS develop
...
ENTRYPOINT [ "tini", "--", "enpt", "nreq" ]
CMD [ "--debug" ]
os-release
  • Display information
    Alpine Linux 3.23.4
    + mini 0.5.0
    Build 2026-04-19T07:47:13Z (aarch64)

    mini 0.5.0
    + busybox 1.37.0
    + ca-certificates 20260413
    + mimalloc 3.3.0
    + su-exec 0.3
    + tini 369448a1
    Build sh_2026-04-19T07:46:32Z (aarch64)

Custom Scripts

ansi-colors
  • Add ANSI colors to shell scripting
#!/bin/ash
set -euo pipefail
. ansi-colors
...

Tag summary

Content type

Image

Digest

sha256:85e6261c9

Size

4.3 MB

Last updated

about 1 month ago

docker pull kgrv/alpine