netmaker/Dockerfile
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

20 lines
498 B
Docker

#first stage - builder
FROM gravitl/go-builder:1.23.0 AS builder
ARG tags
WORKDIR /app
COPY . .
RUN GOOS=linux CGO_ENABLED=1 go build -ldflags="-s -w " -tags ${tags} .
# RUN go build -tags=ee . -o netmaker main.go
FROM alpine:3.21.3
# add a c lib
# set the working directory
WORKDIR /root/
RUN apk upgrade --no-cache
RUN apk add --no-cache sqlite
RUN mkdir -p /etc/netclient/config
COPY --from=builder /app/netmaker .
COPY --from=builder /app/config config
EXPOSE 8081
ENTRYPOINT ["./netmaker"]