next
This commit is contained in:
parent
dd8ba9a40f
commit
0a6a9920b1
1 changed files with 12 additions and 7 deletions
|
@ -49,16 +49,20 @@ RUN echo "setting up git" && \
|
||||||
export ENV2INI="environment-to-ini" && \
|
export ENV2INI="environment-to-ini" && \
|
||||||
export GOFILE="contrib/$ENV2INI/$ENV2INI.go" && \
|
export GOFILE="contrib/$ENV2INI/$ENV2INI.go" && \
|
||||||
echo "compiling for linux/amd64" && \
|
echo "compiling for linux/amd64" && \
|
||||||
GOOS=linux GOARCH=amd64 go build -o "${OUT}/linux/amd64/$ENV2INI" "${GOFILE}" && \
|
(GOOS=linux GOARCH=amd64 go build -o "${OUT}/linux/amd64/$ENV2INI" "${GOFILE}") && \
|
||||||
echo "compiling for linux/arm64" && \
|
echo "compiling for linux/arm64" && \
|
||||||
GOOS=linux GOARCH=arm64 go build -o "${OUT}/linux/arm64/$ENV2INI "${GOFILE}" && \
|
(GOOS=linux GOARCH=arm64 go build -o "${OUT}/linux/arm64/$ENV2INI "${GOFILE}") && \
|
||||||
cd / && \
|
cd / && \
|
||||||
echo "Copying future root addons" && \
|
echo "Copying future root addons" && \
|
||||||
cp -r /build"${DR}/* "${DR}/ && \
|
cp -r /build"${DR}/* "${DR}/ && \
|
||||||
echo "Fixing permissions" && \
|
echo "Fixing permissions" && \
|
||||||
chmod 755 "${DR}/usr/bin/entrypoint "${DR}/usr/local/bin/gitea "${DR}/etc/s6/gitea/* "${DR}/etc/s6/openssh/* "${DR}/etc/s6/.s6-svscan/* && \
|
chmod 755 "${DR}/usr/bin/entrypoint "${DR}/usr/local/bin/gitea "${DR}/etc/s6/gitea/* "${DR}/etc/s6/openssh/* "${DR}/etc/s6/.s6-svscan/* && \
|
||||||
echo "removing git repo" && \
|
echo "removing git repo" && \
|
||||||
rm -Rf /build
|
rm -Rf /build && \
|
||||||
|
echo "removing go cached files" && \
|
||||||
|
rm -Rf "$(go env GOCACHE)" && \
|
||||||
|
rm -Rf "$(go env GOROOT)/pkg" && \
|
||||||
|
rm -Rf "$(go env GOPATH)/pkg"
|
||||||
|
|
||||||
# Main build
|
# Main build
|
||||||
FROM alpine:3.17.0
|
FROM alpine:3.17.0
|
||||||
|
@ -103,10 +107,11 @@ CMD ["/bin/s6-svscan", "/etc/s6"]
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||||
|
|
||||||
ARG OUT "/out-bins"
|
# Shorthands for easy use and ease of replacement
|
||||||
ENV OUT "${OUT}"
|
ARG OUT
|
||||||
ARG DR "/docker/root"
|
ENV OUT "${OUT:-/out-bins}"
|
||||||
ENV DR "${DR}"
|
ARG DR
|
||||||
|
ENV DR "${DR:-"/docker/root"}"
|
||||||
|
|
||||||
COPY --from=build-env "${DR}" /
|
COPY --from=build-env "${DR}" /
|
||||||
COPY --from=build-env --chmod=755 "${OUT}/$TARGETPLATFORM/*" /app/gitea/
|
COPY --from=build-env --chmod=755 "${OUT}/$TARGETPLATFORM/*" /app/gitea/
|
||||||
|
|
Loading…
Add table
Reference in a new issue