mirror of https://github.com/ginuerzh/gost
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
425 B
25 lines
425 B
FROM --platform=$BUILDPLATFORM golang:1-alpine as builder
|
|
|
|
# Convert TARGETPLATFORM to GOARCH format
|
|
# https://github.com/tonistiigi/xx
|
|
COPY --from=tonistiigi/xx:golang / /
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
RUN apk add --no-cache musl-dev git gcc
|
|
|
|
ADD . /src
|
|
|
|
WORKDIR /src
|
|
|
|
ENV GO111MODULE=on
|
|
|
|
RUN cd cmd/gost && go env && go build -v
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /bin/
|
|
|
|
COPY --from=builder /src/cmd/gost/gost .
|
|
|
|
ENTRYPOINT ["/bin/gost"]
|
|
|