Fix args and building
continuous-integration/drone/push Build is passing Details

This commit is contained in:
IamTheFij 2024-01-06 15:30:41 -08:00
parent be4e0a179a
commit 9deac7cc7e
3 changed files with 8 additions and 10 deletions

View File

@ -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

View File

@ -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/

View File

@ -1,5 +1,5 @@
APP_NAME = nomad-var-dirsync
DOCKER_TAG ?= $(APP_NAME)-USER
DOCKER_TAG ?= $(APP_NAME)-$(USER)
VERSION ?= $(shell git describe --tags --dirty)
GOFILES = *.go
# Multi-arch targets are generated from this