2020-08-10 23:48:13 -04:00
|
|
|
FROM golang:alpine AS build_base
|
2020-06-30 22:03:12 -04:00
|
|
|
#ENV GOARCH arm64
|
|
|
|
#ENV GOARCH amd64
|
|
|
|
RUN apk add --no-cache git gcc ca-certificates libc-dev \
|
|
|
|
&& mkdir -p /go/src/github.com/librespeed/ \
|
|
|
|
&& cd /go/src/github.com/librespeed/ \
|
|
|
|
&& git clone https://github.com/librespeed/speedtest-go.git
|
|
|
|
WORKDIR /go/src/github.com/librespeed/speedtest-go
|
|
|
|
RUN go get ./ && go build -ldflags "-w -s" -trimpath -o speedtest main.go
|
|
|
|
|
2022-01-18 02:46:15 -05:00
|
|
|
FROM alpine:3.15
|
2020-06-30 22:03:12 -04:00
|
|
|
RUN apk add ca-certificates
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build_base /go/src/github.com/librespeed/speedtest-go/speedtest .
|
2021-10-17 09:51:13 -04:00
|
|
|
COPY --from=build_base /go/src/github.com/librespeed/speedtest-go/web/assets ./assets
|
2020-06-30 22:03:12 -04:00
|
|
|
COPY --from=build_base /go/src/github.com/librespeed/speedtest-go/settings.toml .
|
|
|
|
|
|
|
|
EXPOSE 8989
|
|
|
|
|
2020-08-10 23:48:13 -04:00
|
|
|
CMD ["./speedtest"]
|