Skip to content
Permalink
70c7b6775c
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
39 lines (25 sloc) 909 Bytes
FROM golang:1.18-alpine3.17 as builder
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
#RUN apk --update add --no-cache build-base
WORKDIR /work
COPY go.mod go.sum /work/
ENV GO111MODULE on
#ENV GOPROXY=https://goproxy.cn,direct
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE $IMAGE_TAG
ARG VERSION
ENV VERSION $IMAGE_TAG
RUN go mod download
COPY ./ /work
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOARM=6 go build -ldflags '-w -s' -o api_server vlink.dev/eoefans/cmd/api
FROM alpine as prod
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache ca-certificates tzdata
ENV TZ Asia/Shanghai
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE $IMAGE_TAG
ARG VERSION
ENV VERSION $IMAGE_TAG
COPY --from=builder /work/api_server ./
EXPOSE 8080
CMD ["./api_server", "-f", "config/config.yml"]