use goreleaser paths for input binary in dockerfiles/makefile

This commit is contained in:
Alex Goodman 2019-09-22 22:42:12 -04:00
parent 3229efafa5
commit 0364bf8702
No known key found for this signature in database
GPG key ID: 98AF011C5C78EB7E
5 changed files with 11 additions and 8 deletions

View file

@ -2,6 +2,7 @@
/.data
/.cover
/dist
!/dist/dive_linux_amd64
/ui
/utils
/image

View file

@ -1,3 +1,3 @@
FROM alpine:3.10
COPY dive /
COPY dist/dive_linux_amd64/dive /
ENTRYPOINT ["/dive"]

View file

@ -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"]

View file

@ -1,3 +1,3 @@
FROM scratch
COPY dive /
COPY dist/dive_linux_amd64/dive /
ENTRYPOINT ["/dive"]

View file

@ -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