mirror of
https://github.com/glauth/glauth.git
synced 2026-10-25 05:30:47 +00:00
e7195ed983
Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de> Co-authored-by: Zhou Wenzong <wenzong@users.noreply.github.com> Co-authored-by: Jairo Llopis <Yajo@users.noreply.github.com> Co-authored-by: Benedikt Kulmann <benedikt@kulmann.biz> Co-authored-by: Nicolai Willems <172633+nwillems@users.noreply.github.com> Co-authored-by: Thibault Soubiran <soubi.thibault@gmail.com> Co-authored-by: Clement JACOB <clems71@gmail.com> Co-authored-by: Lutz Horn <code@lhorn.de> Co-authored-by: Márk Sági-Kazár <sagikazarmark@users.noreply.github.com> Co-authored-by: Peter Heise <pheise@koprolalie.com> Co-authored-by: Ben Yanke <ben@benyanke.com> Co-authored-by: fanlix <fanlix@gmail.com> Co-authored-by: Hank Donnay <hdonnay@gmail.com>
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
#################
|
|
# Build Step
|
|
#################
|
|
|
|
FROM golang:alpine as build
|
|
LABEL maintainers="Ben Yanke <ben@benyanke.com>, Jörn Friedrich Dreyer <jfd@butonic.de>, Chris F Ravenscroft <chris@voilaweb.com>"
|
|
|
|
# Setup work env
|
|
RUN mkdir /app /tmp/gocode
|
|
ADD . /app/
|
|
WORKDIR /app
|
|
|
|
# Required envs for GO
|
|
ENV GOPATH=/tmp/gocode
|
|
ENV GOOS=linux
|
|
ENV GOARCH=amd64
|
|
ENV CGO_ENABLED=0
|
|
|
|
# Only needed for alpine builds // also: busybox
|
|
RUN apk add --no-cache git make busybox-static dumb-init
|
|
|
|
# Install deps
|
|
RUN go get -d -v ./...
|
|
|
|
# Build and copy final result -- wrong file BTW
|
|
RUN uname -a
|
|
RUN if [ $(uname -m) == x86_64 ]; then make linux64 && cp ./bin/glauth64 /app/glauth; fi
|
|
RUN if [ $(uname -m) == aarch64 ]; then make linuxarm64 && cp ./bin/glauth-arm64 /app/glauth; fi
|
|
RUN if [ $(uname -m) == armv7l ]; then make linuxarm32 && cp ./bin/glauth-arm32 /app/glauth; fi
|
|
|
|
# Check glauth works
|
|
RUN /app/glauth --version
|
|
|
|
#################
|
|
# Run Step
|
|
#################
|
|
|
|
FROM gcr.io/distroless/base-debian10 as run
|
|
LABEL maintainers="Ben Yanke <ben@benyanke.com>, Jörn Friedrich Dreyer <jfd@butonic.de>, Chris F Ravenscroft <chris@voilaweb.com>"
|
|
|
|
# Copy binary from build container
|
|
COPY --from=build /app/glauth /app/glauth
|
|
|
|
# Copy docker specific scripts from build container
|
|
COPY --from=build /app/scripts/docker/start-standalone.sh /app/docker/
|
|
COPY --from=build /app/scripts/docker/default-config-standalone.cfg /app/docker/
|
|
|
|
# Just what we need
|
|
COPY --from=build /usr/bin/dumb-init /usr/bin/dumb-init
|
|
COPY --from=build /bin/busybox.static /bin/sh
|
|
COPY --from=build /bin/busybox.static /bin/ln
|
|
COPY --from=build /bin/busybox.static /bin/rm
|
|
RUN ln /bin/sh /usr/bin/cp && ln /bin/sh /usr/bin/mkdir && rm /bin/ln /bin/rm
|
|
|
|
# Install init
|
|
|
|
# Expose web and LDAP ports
|
|
EXPOSE 389 636 5555
|
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
CMD ["/bin/sh", "/app/docker/start-standalone.sh"]
|