Skip to content
Permalink
f54230c48d
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
35 lines (21 sloc) 838 Bytes
FROM golang:1.20-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
ENV SENTRY_RELEASE $IMAGE_TAG
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 spider vlink.dev/eoefans/cmd/spider
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
ENV SENTRY_RELEASE $IMAGE_TAG
ENV VERSION $IMAGE_TAG
COPY --from=builder /work/spider ./
EXPOSE 9266
CMD ["./spider", "-f", "config/config.yml"]