netmaker/docker/Dockerfile-netclient-multiarch
Peter Dave Hello 105b7dfc1c
Simplify and unify apk usage in Dockerfiles (#3407)
Replace `apk update` and `--update` flags with `--no-cache` across
Dockerfiles to improve consistency and eliminate unnecessary cache files.

This change reduces image size and ensures up-to-date package indices
without leaving temporary data. It also aligns with best practices
recommended for Alpine-based Docker images.
2025-04-30 02:55:34 +04:00

22 lines
580 B
Text

FROM gravitl/go-builder as builder
# add glib support daemon manager
WORKDIR /app
ARG version
COPY . .
ENV GO111MODULE=auto
RUN GOOS=linux CGO_ENABLED=0 /usr/local/go/bin/go build -ldflags="-X 'main.version=${version}'" -o netclient-app netclient/main.go
FROM alpine:3.16.2
WORKDIR /root/
RUN apk add --no-cache bash libmnl gcompat iptables openresolv iproute2 wireguard-tools
COPY --from=builder /app/netclient-app ./netclient
COPY --from=builder /app/scripts/netclient.sh .
RUN chmod 0755 netclient && chmod 0755 netclient.sh
ENTRYPOINT ["/bin/bash", "./netclient.sh"]