-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 1.24 KB
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
FROM alpine:latest@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 AS builder
ARG ARCH="amd64"
ARG REPO="userdocs/iperf3-static"
# Add metadata labels for easy parsing
LABEL org.opencontainers.image.base.name="alpine:latest" \
org.opencontainers.image.base.id="alpine" \
org.opencontainers.image.base.codename="latest" \
org.opencontainers.image.title="iperf3-static" \
org.opencontainers.image.description="statically linked iperf3 linux binaries built on Alpine Linux" \
org.opencontainers.image.source="https://github.com/userdocs/iperf3-static" \
org.opencontainers.image.url="https://github.com/userdocs/iperf3-static" \
org.opencontainers.image.documentation="https://github.com/userdocs/iperf3-static/blob/master/README.md" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.vendor="userdocs"
RUN apk update \
&& apk upgrade \
&& apk add sudo \
&& adduser -Ds /bin/bash -u 1000 username \
&& printf '%s' 'username ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/github
ADD --chown=username:username --chmod=700 "https://github.com/${REPO}/releases/latest/download/iperf3-${ARCH}" /usr/local/bin/iperf3
USER username
WORKDIR /home/username