Skip to content

Commit 0a2321f

Browse files
committed
feat: update authzserver Dockerfile
1 parent 1c8c248 commit 0a2321f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

installer/dockerfile/iam-authzserver/Dockerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# license that can be found in the LICENSE file.
44

55
FROM golang:1.19.4 AS builder
6-
WORKDIR /go/src/wecoding/
7-
ADD . iam
8-
RUN cd iam && make build BINS="iam-authzserver"
6+
WORKDIR /go/src/wecoding/iam
7+
ADD . .
8+
RUN make build BINS="iam-authzserver"
99

1010
ARG BASE_IMAGE
1111

@@ -15,16 +15,25 @@ ARG BASE_IMAGE
1515
FROM ${BASE_IMAGE:-alpine:latest}
1616
LABEL maintainer="wecoding@yeah.net"
1717

18-
WORKDIR /opt/iam/
18+
ARG KUBE_VERSION="1.25.0"
19+
ARG TARGETARCH
20+
RUN apk add --update ca-certificates && \
21+
apk add --update openssl bash expat && \
22+
apk add --update -t deps curl && \
23+
curl -L https://storage.googleapis.com/kubernetes-release/release/v$KUBE_VERSION/bin/linux/$TARGETARCH/kubectl -o /usr/local/bin/kubectl && \
24+
chmod +x /usr/local/bin/kubectl && \
25+
apk del --purge deps && \
26+
rm /var/cache/apk/* && \
27+
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
28+
echo "Asia/Shanghai" > /etc/timezone
1929

20-
# This is required by daemon connecting with cri
21-
# RUN apk add --no-cache ca-certificates bash expat
30+
COPY --from=builder /go/src/wecoding/iam/configs/iam-authzserver.yaml /etc/iam/iam-authzserver.yaml
31+
COPY --from=builder /go/src/wecoding/iam/_output/bin/iam-authzserver /usr/local/bin/iam-authzserver
32+
COPY --from=builder /go/src/wecoding/iam/hack/gen-k8s-secret.sh /gen-k8s-secret.sh
2233

23-
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
24-
echo "Asia/Shanghai" > /etc/timezone
34+
RUN chmod +x /gen-k8s-secret.sh
2535

26-
COPY --from=builder /go/src/wecoding/iam/_output/bin/iam-authzserver /usr/local/bin/iam-authzserver
27-
COPY --from=builder /go/src/wecoding/iam/configs/iam-authzserver.yaml /etc/iam/iam-authzserver.yaml
36+
WORKDIR /opt/iam/
2837

2938
EXPOSE 8010
3039

0 commit comments

Comments
 (0)