-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 822 Bytes
/
Dockerfile
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
29
30
31
32
33
34
35
36
#
# Created by Jugal Kishore --- 2020
#
# Speedtest CLI Docker Image
#
# Using Alpine as base
FROM alpine:latest AS builder
# Installing Dependencies
RUN apk --no-cache add wget
# Build time Environment Variable
ARG VERSION="1.2.0"
# Setting Work Directory
WORKDIR /tmp
# Install Speedtest CLI
RUN set -e && \
ARCH=$(arch) && \
if ! wget --quiet --output-document speedtest.tar.tgz https://install.speedtest.net/app/cli/ookla-speedtest-"${VERSION}"-linux-"${ARCH}".tgz; \
then \
echo "Getting Speedtest Failed"; \
exit 1; \
fi
# Extracting Speedtest CLI, and putting in /usr/bin
RUN tar xf speedtest.tar.tgz
FROM alpine:latest AS runner
# Copy Speedtest CLI binary to /usr/bin
COPY --from=builder /tmp/speedtest /usr/bin
COPY speedtest/entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]