diff --git a/.dockerignore b/.dockerignore index 52712ed..1021b60 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,7 @@ /.data /.cover /dist +!/dist/dive_linux_amd64 /ui /utils /image diff --git a/Dockerfile b/Dockerfile index 5aa204a..cfda029 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ FROM alpine:3.10 -COPY dive / +COPY dist/dive_linux_amd64/dive / ENTRYPOINT ["/dive"] diff --git a/Dockerfile.full b/Dockerfile.full index 9273772..a6e7b8d 100644 --- a/Dockerfile.full +++ b/Dockerfile.full @@ -5,6 +5,6 @@ RUN apk --update add curl \ FROM scratch COPY --from=build /tmp/docker / -COPY dive / +COPY dist/dive_linux_amd64/dive / ENV PATH / ENTRYPOINT ["/dive"] diff --git a/Dockerfile.slim b/Dockerfile.slim index a5bd8da..d83f888 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -1,3 +1,3 @@ FROM scratch -COPY dive / +COPY dist/dive_linux_amd64/dive / ENTRYPOINT ["/dive"] diff --git a/Makefile b/Makefile index 15a0574..e9f940f 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,20 @@ BIN = dive +BUILD_DIR = ./dist/dive_linux_amd64/ +BUILD_PATH = $(BUILD_DIR)/$(BIN) all: clean build run: build - ./build/$(BIN) build -t dive-example:latest -f .data/Dockerfile.example . + $(BUILD_PATH) build -t dive-example:latest -f .data/Dockerfile.example . run-ci: build - CI=true ./build/$(BIN) dive-example:latest --ci-config .data/.dive-ci + CI=true $(BUILD_PATH) dive-example:latest --ci-config .data/.dive-ci run-large: build - ./build/$(BIN) amir20/clashleaders:latest + $(BUILD_PATH) amir20/clashleaders:latest build: - CGO_ENABLED=0 go build -o build/$(BIN) + CGO_ENABLED=0 go build -o $(BUILD_PATH) release: test-coverage validate ./.scripts/tag.sh @@ -46,7 +48,7 @@ setup: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.18.0 clean: - rm -rf build + rm -rf dist go clean .PHONY: build install test lint clean release validate generate-test-data test-coverage ci