-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (22 loc) · 933 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (22 loc) · 933 Bytes
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
FROM golang:alpine AS builder
ARG VERSION
ARG GIT_COMMIT
ARG MODEL
ARG API_KEY
ARG API_URL
WORKDIR /app
COPY go.mod go.sum /app/
RUN go mod download
COPY . /app
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X main.Version=$VERSION -X main.GitCommit=$GIT_COMMIT -X main.GitTag=$GIT_TAG -X main.GitRepo=$GIT_REPOSITORY -X main.BuildDate=$BUILD_DATE -X main.InnerModel=$MODEL -X main.InnerApiKey=$API_KEY -X main.InnerApiUrl=$API_URL" -o /app/k8m
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/k8m /app/k8m
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk upgrade && apk add --no-cache curl bash inotify-tools alpine-conf busybox-extras tzdata aws-cli ca-certificates helm tar gzip\
&& apk del alpine-conf && rm -rf /var/cache/* && chmod +x k8m
ADD reload.sh /app/reload.sh
RUN chmod +x /app/reload.sh
#k8m Server
EXPOSE 3618
ENTRYPOINT ["/app/reload.sh","k8m","/app"]