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 /.data
/.cover /.cover
/dist /dist
!/dist/dive_linux_amd64
/ui /ui
/utils /utils
/image /image

View file

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

View file

@ -5,6 +5,6 @@ RUN apk --update add curl \
FROM scratch FROM scratch
COPY --from=build /tmp/docker / COPY --from=build /tmp/docker /
COPY dive / COPY dist/dive_linux_amd64/dive /
ENV PATH / ENV PATH /
ENTRYPOINT ["/dive"] ENTRYPOINT ["/dive"]

View file

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

View file

@ -1,18 +1,20 @@
BIN = dive BIN = dive
BUILD_DIR = ./dist/dive_linux_amd64/
BUILD_PATH = $(BUILD_DIR)/$(BIN)
all: clean build all: clean build
run: 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 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 run-large: build
./build/$(BIN) amir20/clashleaders:latest $(BUILD_PATH) amir20/clashleaders:latest
build: build:
CGO_ENABLED=0 go build -o build/$(BIN) CGO_ENABLED=0 go build -o $(BUILD_PATH)
release: test-coverage validate release: test-coverage validate
./.scripts/tag.sh ./.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 curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b /go/bin v1.18.0
clean: clean:
rm -rf build rm -rf dist
go clean go clean
.PHONY: build install test lint clean release validate generate-test-data test-coverage ci .PHONY: build install test lint clean release validate generate-test-data test-coverage ci