Browse Source

initial commit

master
Andrew Zah 1 year ago
commit
2a9a094a1f
No known key found for this signature in database GPG Key ID: 894E2098341FEC19
  1. 3
      .dockerignore
  2. 32
      Dockerfile
  3. 3
      README.md
  4. 0
      root/etc/cont-init.d/.gitkeep
  5. 20
      root/etc/cont-init.d/10-adduser
  6. 6
      root/etc/cont-init.d/20-set-timezone

3
.dockerignore

@ -0,0 +1,3 @@
*
!/root

32
Dockerfile

@ -0,0 +1,32 @@
FROM alpine:3.13
ENV OVERLAY_VERSION "v2.2.0.1"
ENV OVERLAY_ARCH "amd64"
ENV OVERLAY_RELEASE_URL "https://github.com/just-containers/s6-overlay/releases/download/${OVERLAY_VERSION}/s6-overlay-${OVERLAY_ARCH}-installer"
WORKDIR /tmp
RUN apk add --no-cache \
coreutils \
curl \
shadow \
tzdata \
&& curl -L "$OVERLAY_RELEASE_URL" -o s6-install \
&& chmod +x s6-install \
&& ./s6-install / \
&& apk del --no-cache curl \
&& apk del --purge \
&& rm -rf /tmp/*
RUN groupadd abc \
&& groupmod -g 1000 abc \
&& useradd \
-u 1000 \
-g 1000 \
-d /config \
-s /bin/sh abc \
&& usermod -G abc abc \
&& mkdir -p /app /config /defaults
COPY ./root/ /
ENTRYPOINT [ "/init" ]

3
README.md

@ -0,0 +1,3 @@
# s6-alpine
alpine + [s6 overlay](https://skarnet.org/software/s6/overview.html)

0
root/etc/cont-init.d/.gitkeep

20
root/etc/cont-init.d/10-adduser

@ -0,0 +1,20 @@
#!/usr/bin/with-contenv sh
PUID=${PUID:-1000}
PGID=${PGID:-1000}
groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc
echo "
-------------------------------------
GID/UID
-------------------------------------
User uid: $(id -u abc)
User gid: $(id -g abc)
-------------------------------------
"
chown abc:abc /app
chown abc:abc /config
chown abc:abc /defaults

6
root/etc/cont-init.d/20-set-timezone

@ -0,0 +1,6 @@
#!/usr/bin/with-contenv sh
if [ $TZ ]; then
[ -f /usr/share/zoneinfo/$TZ ] && cp /usr/share/zoneinfo/$TZ /etc/localtime || echo "WARNING: $TZ is not a valid time zone."
[ -f /usr/share/zoneinfo/$TZ ] && echo "$TZ" > /etc/timezone
fi
Loading…
Cancel
Save