From 8c6ded67946a31a92c9e03855206e6292ed8807d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=24i=D1=85?= Date: Sun, 7 Aug 2022 23:21:08 +0300 Subject: [PATCH] refactor: use bin instead of build directory --- .dockerignore | 1 - .gitignore | 1 - Debug.Dockerfile | 4 ++-- Dockerfile | 4 ++-- Makefile | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.dockerignore b/.dockerignore index d90bc82..5c18963 100644 --- a/.dockerignore +++ b/.dockerignore @@ -39,7 +39,6 @@ # Artefacts /bin -/build /data /docs diff --git a/.gitignore b/.gitignore index f3ded8d..7e11089 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,6 @@ # Artefacts /bin -/build /data # Dependency directories (remove the comment below to include it) diff --git a/Debug.Dockerfile b/Debug.Dockerfile index d4d7be5..52556c4 100644 --- a/Debug.Dockerfile +++ b/Debug.Dockerfile @@ -21,7 +21,7 @@ RUN go mod download COPY . . # Build the application -RUN go build -gcflags="all=-N -l" -o /build/app . +RUN go build -gcflags="all=-N -l" -o bin/app . FROM alpine:latest @@ -34,7 +34,7 @@ WORKDIR / # Copy binary from build to main folder COPY --from=builder /go/bin/dlv . -COPY --from=builder /build/app app +COPY --from=builder /source/bin/app app # Copy some application assets COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh diff --git a/Dockerfile b/Dockerfile index 1857eb7..2281b0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN go mod download COPY . . # Build the application -RUN go build -ldflags "-s -w" -o /build/app . +RUN go build -ldflags "-s -w" -o /bin/app . FROM scratch @@ -35,7 +35,7 @@ WORKDIR / # Copy binary from build to main folder COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ -COPY --from=builder /build/app app +COPY --from=builder /bin/app app # Copy some application assets #COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh diff --git a/Makefile b/Makefile index 17d544b..19c1fd9 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ help: ## Display this help screen @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' build: - go build -ldflags "-s -w" -o build/app . + go build -ldflags "-s -w" -o bin/app . run: make build-backoffice-gateway