51 lines
1.1 KiB
Docker
51 lines
1.1 KiB
Docker
FROM scratch
|
||
ADD rootfs.tar.xz /
|
||
|
||
MAINTAINER sparklyballs
|
||
|
||
# set version for s6 overlay
|
||
ARG OVERLAY_VERSION="v1.19.1.1"
|
||
ARG OVERLAY_ARCH="amd64"
|
||
|
||
# environment variables
|
||
ENV PS1="$(whoami)@$(hostname):$(pwd)$ " \
|
||
HOME="/root" \
|
||
TERM="xterm"
|
||
|
||
RUN \
|
||
echo "**** install build packages ****" && \
|
||
apk add --no-cache --virtual=build-dependencies \
|
||
curl \
|
||
tar && \
|
||
echo "**** install runtime packages ****" && \
|
||
apk add --no-cache \
|
||
bash \
|
||
ca-certificates \
|
||
coreutils \
|
||
shadow \
|
||
tzdata && \
|
||
echo "**** add s6 overlay ****" && \
|
||
curl -o \
|
||
/tmp/s6-overlay.tar.gz -L \
|
||
"https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}.tar.gz" && \
|
||
tar xfz \
|
||
/tmp/s6-overlay.tar.gz -C / && \
|
||
echo "**** create abc user and make our folders ****" && \
|
||
groupmod -g 1000 users && \
|
||
useradd -u 911 -U -d /config -s /bin/false abc && \
|
||
usermod -G users abc && \
|
||
mkdir -p \
|
||
/app \
|
||
/config \
|
||
/defaults && \
|
||
echo "**** cleanup ****" && \
|
||
apk del --purge \
|
||
build-dependencies && \
|
||
rm -rf \
|
||
/tmp/*
|
||
|
||
# add local files
|
||
COPY root/ /
|
||
|
||
ENTRYPOINT ["/init"]
|