-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.build
28 lines (24 loc) · 1.09 KB
/
Dockerfile.build
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
FROM golang:alpine AS build
ENV GOPROXY direct
RUN apk --no-cache add git just && \
wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin && \
go install github.com/swaggo/swag/cmd/swag@latest && \
git clone --depth 1 https://github.com/etkecc/emm.git && \
cd emm && just build && mv emm /go/bin/emm && cd .. && \
git clone --depth 1 https://github.com/etkecc/bunny-upload.git && \
cd bunny-upload && just build && mv bunny-upload /go/bin/bunny-upload
FROM docker:latest
# emulate golang:alpine
ENV GOPATH /go
ENV GOPROXY direct
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
COPY --from=build /go/bin/golangci-lint /go/bin/golangci-lint
COPY --from=build /go/bin/swag /go/bin/swag
COPY --from=build /go/bin/emm /go/bin/emm
COPY --from=build /go/bin/bunny-upload /go/bin/bunny-upload
WORKDIR $GOPATH
RUN apk --no-cache add alpine-sdk olm-dev hugo skopeo just npm curl go && \
rm -rf /root/.cache/* && \
go clean -cache -testcache -fuzzcache && \
find / -name '*.pyc' -exec rm {} \;