Skip to content

Base Dockerfile

Alpine

FROM public.ecr.aws/docker/library/alpine:3.18.3

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apk add --no-cache tini=~0.19.0 && \
    addgroup -g $GROUP_GID $GROUP_NAME && \
    adduser -D -u $USER_UID -G $GROUP_NAME $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apk add --no-cache curl=~8.2.1 && \
#     curl --version

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/sbin/tini", "--", "<APPLICATION>" ]

Image Information

FROM amd64/alpine:3.18.3

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apk add --no-cache tini=~0.19.0 && \
    addgroup -g $GROUP_GID $GROUP_NAME && \
    adduser -D -u $USER_UID -G $GROUP_NAME $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apk add --no-cache curl=~8.2.1 && \
#     curl --version

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/sbin/tini", "--", "<APPLICATION>" ]

Image Information

FROM arm64v8/alpine:3.18.3

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apk add --no-cache tini=~0.19.0 && \
    addgroup -g $GROUP_GID $GROUP_NAME && \
    adduser -D -u $USER_UID -G $GROUP_NAME $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apk add --no-cache curl=~8.2.1 && \
#     curl --version

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/sbin/tini", "--", "<APPLICATION>" ]

Image Information

Amazon Linux 2

FROM public.ecr.aws/docker/library/amazonlinux:2.0.20230727.0

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN yum update -y && \
    yum install -y shadow-utils && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    if [ "$(arch)" = "x86_64" ]; then export ARCH="amd64"; else export ARCH="arm64"; fi && \
    curl -o /tini -L https://github.com/krallin/tini/releases/download/"${TINI_VERSION}"/tini-"${ARCH}" && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

FROM amd64/amazonlinux:2.0.20230727.0

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN yum update -y && \
    yum install -y shadow-utils && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    if [ "$(arch)" = "x86_64" ]; then export ARCH="amd64"; else export ARCH="arm64"; fi && \
    curl -o /tini -L https://github.com/krallin/tini/releases/download/"${TINI_VERSION}"/tini-"${ARCH}" && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

FROM arm64v8/amazonlinux:2.0.20230727.0

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN yum update -y && \
    yum install -y shadow-utils && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    if [ "$(arch)" = "x86_64" ]; then export ARCH="amd64"; else export ARCH="arm64"; fi && \
    curl -o /tini -L https://github.com/krallin/tini/releases/download/"${TINI_VERSION}"/tini-"${ARCH}" && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

CentOS

FROM public.ecr.aws/docker/library/centos:7.9.2009

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN yum update -y && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    if [ "$(arch)" = "x86_64" ]; then export ARCH="amd64"; else export ARCH="arm64"; fi && \
    curl -o /tini -L https://github.com/krallin/tini/releases/download/"${TINI_VERSION}"/tini-"${ARCH}" && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

FROM amd64/centos:7.9.2009

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-amd64 /tini

RUN yum update -y && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

FROM arm64v8/centos:7.9.2009

ENV TINI_VERSION v0.19.0

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-arm64 /tini

RUN yum update -y && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chmod +x /tini && \
    chown $USER_NAME:$GROUP_NAME /tini && \
    chown -R $USER_NAME:$GROUP_NAME .

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/tini", "--", "<APPLICATION>" ]

Image Information

Debian

FROM public.ecr.aws/docker/library/debian:11.7-slim

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information

FROM amd64/debian:11.7-slim

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information

FROM arm64v8/debian:11.7-slim

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information

Ubuntu

FROM public.ecr.aws/docker/library/ubuntu:22.04

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information

FROM amd64/ubuntu:22.04

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information

FROM arm64v8/ubuntu:22.04

ENV USER_NAME <USER NAME>
ENV USER_UID <UID NUMBER>

ENV GROUP_NAME <GROUP NAME>
ENV GROUP_GID <GID NUMBER>

ENV WORKDIR <WORKDIR PATH>

WORKDIR $WORKDIR

RUN apt-get update -y && \
    apt-get install -y --no-install-recommends tini=* && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    groupadd -g $GROUP_GID $GROUP_NAME && \
    useradd -l -g $GROUP_NAME -u $USER_UID $USER_NAME && \
    chown -R $USER_NAME:$GROUP_NAME .

# RUN apt-get install -y curl=*

USER $USER_NAME


# COPY [--chown=<user>:<group>] [--chmod=<permission (ex. 755)>] <src> <dest>   # with Docker Buildkit
# RUN ...

ENTRYPOINT [ "/usr/bin/tini", "--", "<APPLICATION>" ]

Image Information