Compare commits

...

2 Commits
v0.0.2 ... main

Author SHA1 Message Date
IamTheFij 9deac7cc7e Fix args and building
continuous-integration/drone/push Build is passing Details
2024-01-06 15:30:41 -08:00
IamTheFij be4e0a179a Fix args in dockerfiles
continuous-integration/drone/push Build is failing Details
2024-01-04 09:42:46 -08:00
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