This commit is contained in:
parent
be4e0a179a
commit
9deac7cc7e
@ -1,6 +1,3 @@
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
FROM alpine:3.19
|
||||
|
||||
RUN mkdir /app
|
||||
@ -10,7 +7,9 @@ WORKDIR /app/
|
||||
RUN addgroup -S nomad-var-dirsync && adduser -S nomad-var-dirsync -G nomad-var-dirsync
|
||||
|
||||
# Copy binary in
|
||||
COPY ./dist/nomad-var-dirsync-${TARGETOS}-${TARGETARCH} ./nomad-var-dirsync
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
COPY ./dist/nomad-var-dirsync-$TARGETOS-$TARGETARCH /bin/nomad-var-dirsync
|
||||
|
||||
# Drop to non-root user
|
||||
USER nomad-var-dirsync
|
||||
|
@ -1,6 +1,3 @@
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
FROM golang:1.21-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git=~2 && mkdir /app
|
||||
@ -12,10 +9,12 @@ RUN go mod download
|
||||
COPY ./*.go /app/
|
||||
|
||||
ARG VERSION=dev
|
||||
ENV CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH}
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH
|
||||
RUN go build -ldflags "-X main.version=VERSION" -a -installsuffix nocgo -o nomad-var-dirsync .
|
||||
|
||||
FROM REPO/alpine:3.19
|
||||
FROM alpine:3.19
|
||||
RUN mkdir /app
|
||||
WORKDIR /app/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user