forked from tsuru/tsuru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (23 loc) · 920 Bytes
/
Dockerfile
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
ARG alpine_version=3.17
ARG golang_version=1.20
FROM golang:${golang_version}-alpine${alpine_version} AS builder
RUN apk add --update --no-cache bash make git
WORKDIR /go/src/github.com/tsuru/tsuru
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN make tsurud
FROM alpine:${alpine_version}
RUN set -x && \
apk add --no-cache ca-certificates
ARG gke_auth_plugin_version=0.1.1
ARG TARGETARCH
RUN set -x \
&& apk add --update --no-cache curl ca-certificates \
&& curl -fsSL "https://github.com/traviswt/gke-auth-plugin/releases/download/${gke_auth_plugin_version}/gke-auth-plugin_Linux_$( [[ ${TARGETARCH} == 'amd64' ]] && echo 'x86_64' || echo ${TARGETARCH} ).tar.gz" \
| tar -C /usr/local/bin -xzvf- gke-auth-plugin \
&& gke-auth-plugin version
EXPOSE 8080
ENTRYPOINT ["/usr/local/bin/tsurud"]
CMD ["api"]
COPY --from=builder /go/src/github.com/tsuru/tsuru/build/tsurud /usr/local/bin/tsurud