github.com/metacubex/quic-go@v0.44.1-0.20240520163451-20b689a59136/interop/Dockerfile (about) 1 FROM martenseemann/quic-network-simulator-endpoint:latest AS builder 2 3 ARG TARGETPLATFORM 4 RUN echo "TARGETPLATFORM: ${TARGETPLATFORM}" 5 6 RUN apt-get update && apt-get install -y wget tar git 7 8 ENV GOVERSION=1.21.4 9 10 RUN platform=$(echo ${TARGETPLATFORM} | tr '/' '-') && \ 11 filename="go${GOVERSION}.${platform}.tar.gz" && \ 12 wget https://dl.google.com/go/${filename} && \ 13 tar xfz ${filename} && \ 14 rm ${filename} 15 16 ENV PATH="/go/bin:${PATH}" 17 18 # build with --build-arg CACHEBUST=$(date +%s) 19 ARG CACHEBUST=1 20 21 # build other branches / commits / tags using --build-arg GITREF="<git reference>" 22 ARG GITREF="master" 23 24 RUN git clone https://github.com/quic-go/quic-go 25 WORKDIR /quic-go 26 RUN git checkout ${GITREF} 27 RUN go get ./... 28 29 RUN git rev-parse HEAD | tee commit.txt 30 RUN go build -o server -ldflags="-X github.com/quic-go/quic-go/qlog.quicGoVersion=$(git describe --always --long --dirty)" interop/server/main.go 31 RUN go build -o client -ldflags="-X github.com/quic-go/quic-go/qlog.quicGoVersion=$(git describe --always --long --dirty)" interop/client/main.go 32 33 34 FROM martenseemann/quic-network-simulator-endpoint:latest 35 36 WORKDIR /quic-go 37 38 COPY --from=builder /quic-go/commit.txt /quic-go/server /quic-go/client ./ 39 40 COPY run_endpoint.sh . 41 RUN chmod +x run_endpoint.sh 42 43 ENTRYPOINT [ "./run_endpoint.sh" ]