forked from koderover/zadig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaslan.Dockerfile
40 lines (28 loc) · 1007 Bytes
/
aslan.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM golang:1.19.1-alpine as build
WORKDIR /app
ENV CGO_ENABLED=0 GOOS=linux
ENV GOPROXY=https://goproxy.cn,direct
ENV GOCACHE=/gocache
COPY go.mod go.sum ./
COPY cmd cmd
COPY pkg pkg
RUN go mod download
RUN --mount=type=cache,id=gobuild,target=/gocache \
go build -v -o /aslan ./cmd/aslan/main.go
FROM alpine/git:v2.30.2
# https://wiki.alpinelinux.org/wiki/Setting_the_timezone
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo Asia/Shanghai > /etc/timezone && \
apk del tzdata
RUN apk update
RUN apk --no-cache add curl
# install ali-acr plugin
RUN curl -fsSL "https://resources.koderover.com/helm-acr_0.8.2_linux_amd64.tar.gz" -o helm-acr.tar.gz &&\
mkdir -p /app/.helm/helmplugin/helm-acr &&\
tar -xvzf helm-acr.tar.gz -C /app/.helm/helmplugin/helm-acr &&\
rm -rf helm-acr*
WORKDIR /app
COPY --from=build /aslan .
ENTRYPOINT ["/app/aslan"]