-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.ldap
52 lines (51 loc) · 1.74 KB
/
Dockerfile.ldap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM docker.io/golang:alpine AS builder
RUN apk add --no-cache gcc git make musl-dev
WORKDIR /tmp
RUN git clone https://github.com/glauth/glauth
WORKDIR /tmp/glauth
RUN git submodule set-url v2/pkg/plugins/glauth-postgres \
https://github.com/glauth/glauth-postgres
RUN git submodule update --init v2/pkg/plugins/glauth-postgres
RUN mkdir v2/pkg/plugins/glauth-keycloak
RUN sed 's/postgres/keycloak/g' \
v2/pkg/plugins/glauth-postgres/Makefile >> \
v2/pkg/plugins/glauth-keycloak/Makefile
WORKDIR /tmp/glauth/v2/pkg/plugins/glauth-keycloak
RUN sed -i 's/^TRIM_FLAGS=.*/TRIM_FLAGS=/' Makefile
RUN go get github.com/go-resty/resty/v2
RUN go get github.com/stretchr/testify/assert
RUN go get golang.org/x/oauth2
WORKDIR /tmp/glauth/v2
RUN make fast
COPY \
glauth-keycloak/*.go \
pkg/plugins/glauth-keycloak/
RUN \
files="$(gofmt -l pkg/plugins/glauth-keycloak)"; \
if [ -n "$files" ]; then \
for file in $files; do \
gofmt $file | diff --unified=0 $file -; \
done; \
false; \
fi
RUN make plugin_keycloak
WORKDIR /tmp/glauth/v2/pkg/plugins/glauth-keycloak
RUN go test .
FROM docker.io/alpine
RUN install -m 755 -o nobody -g nogroup -d /opt/glauth/bin
RUN install -m 755 -o nobody -g nogroup -d /opt/glauth/etc
COPY --from=builder --chown=nobody:nogroup \
/tmp/glauth/v2/bin/linuxamd64/glauth \
/tmp/glauth/v2/bin/linuxamd64/keycloak.so \
/opt/glauth/bin/
COPY --chown=nobody:nogroup files/issue_19321 /usr/local/bin/
COPY --chown=nobody:nogroup files/ldap/glauth.cfg /opt/glauth/etc/
COPY --chown=nobody:nogroup files/state /usr/local/bin/
COPY --chown=nobody:nobody files/ldap/entrypoint /
WORKDIR /opt/glauth
USER nobody:nogroup
ENV KEYCLOAK_PORT ""
ENV KEYCLOAK_REALM ""
ENV LDAP_PORT ""
ENV VSPHERE_DOMAIN ""
ENTRYPOINT ["/entrypoint"]