From ef2bacb0c4f3ffc21bead2fe7cccbf036c0bd827 Mon Sep 17 00:00:00 2001
From: Vitaliy Filippov <vitalif@yourcmc.ru>
Date: Fri, 5 Aug 2022 15:20:29 +0300
Subject: [PATCH] Move Dockerfile to /

---
 cmd/s3driver/Dockerfile => Dockerfile | 4 +++-
 Makefile                              | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
 rename cmd/s3driver/Dockerfile => Dockerfile (90%)

diff --git a/cmd/s3driver/Dockerfile b/Dockerfile
similarity index 90%
rename from cmd/s3driver/Dockerfile
rename to Dockerfile
index 6b3ac80..4a18354 100644
--- a/cmd/s3driver/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,9 @@
 FROM golang:1.16-alpine as gobuild
 
 WORKDIR /build
-ADD . /build
+ADD go.mod go.sum /build/
+ADD cmd /build/cmd
+ADD pkg /build/pkg
 
 RUN go get -d -v ./...
 RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o ./s3driver ./cmd/s3driver
diff --git a/Makefile b/Makefile
index a8ebed6..45bc019 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,7 @@ test:
 	docker build -t $(TEST_IMAGE_TAG) -f test/Dockerfile .
 	docker run --rm --privileged -v $(PWD):/build --device /dev/fuse $(TEST_IMAGE_TAG)
 container:
-	docker build -t $(IMAGE_TAG) -f cmd/s3driver/Dockerfile .
+	docker build -t $(IMAGE_TAG) .
 push: container
 	docker tag $(IMAGE_TAG) $(REGISTRY_NAME)/$(IMAGE_NAME):latest
 	docker tag $(IMAGE_TAG) $(REGISTRY_NAME)/$(IMAGE_NAME2):$(VERSION)