From 3510bf133352f3c38d02b91f61ed1ebd9e8b3514 Mon Sep 17 00:00:00 2001 From: Caleb Horst Date: Tue, 22 Nov 2022 14:33:14 -0800 Subject: [PATCH] Don't use make in the Dockerfile (#19) --- Dockerfile | 4 +++- Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 816005177..ca75ffd05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM golang:1.19-alpine3.16 AS builder ARG VERSION +ARG DATABASE +ARG SOURCE RUN apk add --no-cache git gcc musl-dev make @@ -13,7 +15,7 @@ RUN go mod download COPY . ./ -RUN make build-docker +RUN CGO_ENABLED=0 go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$(DATABASE) $(SOURCE)" ./cmd/migrate FROM alpine:3.16 diff --git a/Makefile b/Makefile index 382327b48..877418831 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build-cli: clean cat ./cli/build/sha256sum.txt build: - docker build --build-arg VERSION=$(VERSION) . -t infoblox/migrate -t infoblox/migrate:$(VERSION) + docker build --build-arg VERSION=$(VERSION) --build-arg DATABASE="$(DATABASE)" --build-arg SOURCE="$(SOURCE)" . -t infoblox/migrate -t infoblox/migrate:$(VERSION) docker-push: docker push infoblox/migrate:$(VERSION)