[BUGFIX] Fix Dockerfile WORKDIR (#1392)

The WORKDIR needs to be set early to ensure that the files are copied into the appropriate directory.
This is a minor regression that was introduced in af2ae328e7.
pull/1381/head
Amir Zarrinkafsh 2020-10-19 11:24:24 +11:00 committed by GitHub
parent af2ae328e7
commit 15b165f503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -51,12 +51,12 @@ GOOS=linux GOARCH=amd64 CGO_ENABLED=1 go build -tags netgo -ldflags '-s -w -link
# =================================== # ===================================
FROM alpine:3.12.0 FROM alpine:3.12.0
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./ WORKDIR /app
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN apk --no-cache add ca-certificates su-exec tzdata RUN apk --no-cache add ca-certificates su-exec tzdata
WORKDIR /app COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE 9091 EXPOSE 9091

View File

@ -54,14 +54,15 @@ GOOS=linux GOARCH=arm CGO_ENABLED=1 CC=arm-linux-musleabihf-gcc go build -tags n
# =================================== # ===================================
FROM arm32v7/alpine:3.12.0 FROM arm32v7/alpine:3.12.0
WORKDIR /app
COPY ./qemu-arm-static /usr/bin/qemu-arm-static COPY ./qemu-arm-static /usr/bin/qemu-arm-static
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN apk --no-cache add ca-certificates su-exec tzdata && \ RUN apk --no-cache add ca-certificates su-exec tzdata && \
rm /usr/bin/qemu-arm-static rm /usr/bin/qemu-arm-static
WORKDIR /app COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE 9091 EXPOSE 9091

View File

@ -54,14 +54,15 @@ GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=aarch64-linux-musl-gcc go build -tags n
# =================================== # ===================================
FROM arm64v8/alpine:3.12.0 FROM arm64v8/alpine:3.12.0
WORKDIR /app
COPY ./qemu-aarch64-static /usr/bin/qemu-aarch64-static COPY ./qemu-aarch64-static /usr/bin/qemu-aarch64-static
COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
RUN apk --no-cache add ca-certificates su-exec tzdata && \ RUN apk --no-cache add ca-certificates su-exec tzdata && \
rm /usr/bin/qemu-aarch64-static rm /usr/bin/qemu-aarch64-static
WORKDIR /app COPY --from=builder-backend /go/src/app/cmd/authelia/authelia ./
COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE 9091 EXPOSE 9091