-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mr. Rubber Ducky (Simon) <[email protected]>
- Loading branch information
1 parent
f116a1f
commit d9f9c87
Showing
1 changed file
with
27 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
MAINTAINER MrRubberDucky <[email protected]> | ||
|
||
# ============================================================================= | ||
# 1. ALPINE BUILDER STAGE | ||
# ============================================================================= | ||
|
||
ARG ALPINE_VERSION=latest | ||
ARG ALPINE_VERSION=3.19.0 | ||
|
||
FROM docker.io/library/alpine:${ALPINE_VERSION} AS alpine-builder | ||
FROM docker.io/library/${ARCH}/alpine:${ALPINE_VERSION} AS alpine-builder | ||
WORKDIR /app | ||
|
||
# For clean-up, each stage is labeled | ||
LABEL stage=alpine-builder | ||
|
||
ARG ALPINE_VERSION=latest \ | ||
CADDY_VERSION=latest \ | ||
BUILD_VERSION=0.1.0 \ | ||
ARG ALPINE_VERSION=3.19.0 \ | ||
CADDY_VERSION=2.7.6 \ | ||
BUILD_VERSION=0.10 \ | ||
SHELL=/bin/bash \ | ||
GOPATH=/app/go \ | ||
USER=caddy \ | ||
|
@@ -28,16 +30,20 @@ COPY --chmod=0755 scripts/array-helper.sh /app/helper/array-helper.sh | |
COPY templates/templatebuild.bashrc /app/temp.bashrc | ||
COPY templates/template.MODULES /app/helper/.MODULES | ||
|
||
RUN echo "Installing dependencies" \ | ||
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
bash \ | ||
git \ | ||
envsubst \ | ||
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
xcaddy \ | ||
ca-certificates \ | ||
RUN echo "Installing dependencies" \ | ||
&& apk add --no-cache --virtual build_community --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
bash \ | ||
git \ | ||
envsubst \ | ||
&& apk add --no-cache --virtual build_testing --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
xcaddy \ | ||
ca-certificates \ | ||
&& envsubst < /app/temp.bashrc > /app/.bashrc \ | ||
&& /bin/bash -c /app/helper/array-helper.sh | ||
&& /bin/bash -c /app/helper/array-helper.sh \ | ||
&& apk del --rdepends \ | ||
build_community \ | ||
build_testing \ | ||
&& rm -rf /app | ||
|
||
# ============================================================================= | ||
# 2. ALPINE BASE STAGE | ||
|
@@ -48,9 +54,9 @@ WORKDIR /app | |
|
||
LABEL stage=qor-caddy | ||
|
||
ARG ALPINE_VERSION=latest \ | ||
CADDY_VERSION=latest \ | ||
BUILD_VERSION=0.1.0 \ | ||
ARG ALPINE_VERSION=3.19.0 \ | ||
CADDY_VERSION=2.7.6 \ | ||
BUILD_VERSION=0.10 \ | ||
SHELL=/bin/bash \ | ||
GOPATH=/app/go \ | ||
USER=caddy \ | ||
|
@@ -72,6 +78,7 @@ EXPOSE 2019 | |
RUN echo "Installing dependencies, setting up users etc." \ | ||
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
bash \ | ||
&& apk add --no-cache --virtual env_set --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
envsubst \ | ||
&& apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \ | ||
ca-certificates \ | ||
|
@@ -87,10 +94,11 @@ RUN echo "Installing dependencies, setting up users etc." \ | |
--disabled-password \ | ||
"$USER" \ | ||
&& adduser \ | ||
"$USER" \ | ||
"$USER" \ | ||
netdev \ | ||
&& chown -R "$USER":"$GROUP" /srv /app \ | ||
&& envsubst < /app/template.bashrc > /app/.bashrc \ | ||
&& rm /bin/ash /app/template.bashrc | ||
&& rm /bin/ash /app/template.bashrc \ | ||
&& apk del --rdepends envsubst \ | ||
|
||
ENTRYPOINT /app/scripts/docker-entrypoint.sh |