From 049dcd460045617f8f6237da3b054a62df0dce8d Mon Sep 17 00:00:00 2001 From: Igor Bukanov Date: Mon, 10 Jun 2024 14:51:31 +0200 Subject: [PATCH] chore: Docker volumes with relative paths Docker supports using relative path for bind-mounted volumes. So use those rather than PWD. This also makes Makefile more compatible with Windows. --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7a9ffe9ee..ea7febb2f 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ docker: docker tag bat-go:$(GIT_VERSION)$(BUILD_TIME) bat-go:latest docker-reproducible: - docker run -v $(PWD):/workspace --network=host \ + docker run -v .:/workspace --network=host \ gcr.io/kaniko-project/executor:latest \ --reproducible --dockerfile /workspace/Dockerfile \ --no-push --tarPath /workspace/bat-go-repro.tar \ @@ -190,11 +190,11 @@ format-lint: make format && make lint lint: ensure-gomod-volume - docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/main golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... - docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/cmd golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... - docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/libs golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... - docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/services golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... - docker run --rm -v "$$(pwd):/app" -v batgo_lint_gomod:/go/pkg --workdir /app/tools golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... + docker run --rm -v ".:/app" -v batgo_lint_gomod:/go/pkg --workdir /app/main golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... + docker run --rm -v ".:/app" -v batgo_lint_gomod:/go/pkg --workdir /app/cmd golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... + docker run --rm -v ".:/app" -v batgo_lint_gomod:/go/pkg --workdir /app/libs golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... + docker run --rm -v ".:/app" -v batgo_lint_gomod:/go/pkg --workdir /app/services golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... + docker run --rm -v ".:/app" -v batgo_lint_gomod:/go/pkg --workdir /app/tools golangci/golangci-lint:v1.49.0 golangci-lint run -v ./... download-mod: cd ./cmd && go mod download && cd ..