From d87a5a89d67baf90e796bb60454b7743edac27e4 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Mon, 24 May 2021 14:24:01 +0300 Subject: [PATCH] [#57] *: Fix docker builds Added dep dependency before image target, made `run make` without dep in dockerfile. Signed-off-by: Angira Kekteeva --- Dockerfile | 4 +++- Makefile | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f8d308e..db8eb0dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,10 @@ RUN set -x \ COPY . /src +ARG REPO=github.com/nspcc-dev/neofs-s3-gw ARG VERSION=dev -RUN make +RUN set -x && make -o dep # run make without dep dependency # Executable image FROM scratch @@ -18,6 +19,7 @@ FROM scratch WORKDIR / COPY --from=builder /src/bin/neofs-s3-gw /bin/neofs-s3-gw +COPY --from=builder /src/bin/neofs-authmate /bin/neofs-authmate COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ ENTRYPOINT ["/bin/neofs-s3-gw"] diff --git a/Makefile b/Makefile index 1c73d75c..6609e486 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ CMDS = $(addprefix neofs-, $(notdir $(wildcard cmd/*))) BINS = $(addprefix $(BINDIR)/, $(CMDS)) # Variables for docker -HUB_IMAGE ?= "nspccdev/$(BIN_NAME)" +REPO_BASENAME = $(shell basename `go list -m`) +HUB_IMAGE ?= "nspccdev/$(REPO_BASENAME)" HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')" .PHONY: help all dep clean format test cover lint docker/lint image-push image dirty-image @@ -55,7 +56,7 @@ format: @goimports -w ./ # Build clean Docker image -image: +image: dep @echo "⇒ Build NeoFS S3 Gateway docker image " @docker build \ --build-arg REPO=$(REPO) \