Distribute authelia-scripts in docker image

Building and copying the authelia-scripts binary so that migrations can
easily be ran.
This commit is contained in:
Mike Kusold 2019-12-23 20:23:02 -07:00 committed by Amir Zarrinkafsh
parent fabb76754e
commit 511b0b3c62
3 changed files with 15 additions and 3 deletions

View File

@ -27,7 +27,10 @@ RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia && GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia
RUN cd cmd/authelia && GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia && cd ../../
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia-scripts && GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -o authelia-scripts
# ========================================
@ -51,6 +54,7 @@ RUN apk --no-cache add ca-certificates tzdata
WORKDIR /usr/app
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia authelia
COPY --from=builder-backend /go/src/app/cmd/authelia-scripts/authelia-scripts authelia-scripts
COPY --from=builder-frontend /node/src/app/build public_html
EXPOSE 9091

View File

@ -28,7 +28,10 @@ RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia && GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia
RUN cd cmd/authelia && GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia && cd ../../
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia-scripts && GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -o authelia-scripts
# ========================================
@ -55,6 +58,7 @@ RUN apk --no-cache add ca-certificates tzdata && \
WORKDIR /usr/app
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia authelia
COPY --from=builder-backend /go/src/app/cmd/authelia-scripts/authelia-scripts authelia-scripts
COPY --from=builder-frontend /node/src/app/build public_html
EXPOSE 9091

View File

@ -28,7 +28,10 @@ RUN echo "Write tag ${BUILD_TAG} and commit ${BUILD_COMMIT} in binary." && \
sed -i "s/__BUILD_TIME__/${BUILD_TIME}/" cmd/authelia/constants.go
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia && GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia
RUN cd cmd/authelia && GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -tags netgo -ldflags '-w' -o authelia && cd ../../
# CGO_ENABLED=1 is mandatory for building go-sqlite3
RUN cd cmd/authelia-scripts && GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -o authelia-scripts
# ========================================
@ -55,6 +58,7 @@ RUN apk --no-cache add ca-certificates tzdata && \
WORKDIR /usr/app
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia authelia
COPY --from=builder-backend /go/src/app/cmd/authelia-scripts/authelia-scripts authelia-scripts
COPY --from=builder-frontend /node/src/app/build public_html
EXPOSE 9091