-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
23 lines (19 loc) · 897 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# DO NOT USE bullseye for buildx see https://github.com/docker/buildx/issues/314
FROM golang:1.19.1-buster as builder
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y update && apt-get -y install build-essential pkg-config && apt-get clean
RUN mkdir -p /internet-speed-monitor
WORKDIR /internet-speed-monitor
ENV GO111MODULE on
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 go build -o internet-speed-monitor
###
FROM debian:buster-slim as final
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y update && apt-get -y install curl
RUN curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | bash
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install speedtest && apt-get clean
RUN mkdir -p /internet-speed-monitor
WORKDIR /internet-speed-monitor
COPY --from=builder /internet-speed-monitor .
RUN chmod +x internet-speed-monitor
CMD ["./internet-speed-monitor"]