Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (37 loc) · 1.59 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# SPDX-FileCopyrightText: 2022-present Intel Corporation
# SPDX-FileCopyrightText: 2021 Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
#
FROM golang:1.27.4-bookworm@sha256:ce59b41415e2524ae99926fe1f37ce48ba8c194dcbd2a56a65436cdcefa2bd34 AS builder
WORKDIR $GOPATH/src/smf
COPY . .
ARG MAKEFLAGS
RUN make all
FROM alpine:3.24@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf AS smf
# Build arguments for dynamic labels
ARG VERSION=dev
ARG VCS_URL=unknown
ARG VCS_REF=unknown
ARG BUILD_DATE=unknown
LABEL org.opencontainers.image.source="${VCS_URL}" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.url="${VCS_URL}" \
org.opencontainers.image.title="smf" \
org.opencontainers.image.description="Aether 5G Core SMF Network Function" \
org.opencontainers.image.authors="Aether SD-Core <dev@lists.aetherproject.org>" \
org.opencontainers.image.vendor="Aether Project" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.documentation="https://docs.sd-core.aetherproject.org/"
ARG DEBUG_TOOLS
RUN apk add --no-cache bash && \
if [ "$DEBUG_TOOLS" = "true" ]; then \
apk add --no-cache vim nano strace net-tools curl netcat-openbsd bind-tools; \
fi
# Run as an unprivileged user
RUN addgroup -S -g 1000 aether && adduser -S -u 1000 -G aether aether
# Copy executable
COPY --chmod=755 --from=builder /go/src/smf/bin/* /usr/local/bin/.
USER 1000:1000