Skip to content

Commit

Permalink
fix: fix binary file loss issue
Browse files Browse the repository at this point in the history
  • Loading branch information
0xff-dev committed Jul 3, 2023
1 parent cc906dc commit 8961f8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ golanglint-fix:
# make image
.PHONY: images
image:
@REGISTRY=$(REGISTRY) OUTPUT_TYPE=$(OUTPUT_TYPE) BUILD_PLATFORMS=$(GOOS)/$(GOARCH) hack/build-image.sh $(filter ${DOCKER_TARGETS}, ${WHAT})
@REGISTRY=$(REGISTRY) OUTPUT_TYPE=$(OUTPUT_TYPE) BUILD_PLATFORMS=$(GOOS)/$(GOARCH) OS=$(GOOS) ARCH=$(GOARCH) hack/build-image.sh $(filter ${DOCKER_TARGETS}, ${WHAT})
5 changes: 4 additions & 1 deletion build/dockerfile.bc-cli
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
ARG ARCH
FROM golang:1.20.2
ARG ARCH=amd64

WORKDIR /go/src/github.com/bestchains/bc-cli
COPY . .
RUN make binary GOARCH=${ARCH} GOOS=linux

FROM alpine:3.16
ARG ARCH=amd64

COPY --from=0 /go/src/github.com/bestchains/bc-cli/_output/bin/linux/${ARCH}/bc-cli /bin/bc-cli
WORKDIR /bin
2 changes: 2 additions & 0 deletions hack/lib/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function docker::build() {
docker buildx build --progress=plain --output=type=$output_type \
--platform "${BUILD_PLATFORMS}" \
--build-arg ="${target}" \
--build-arg ARCH="${ARCH}" \
--build-arg OS="${OS}" \
--tag "${image_name}" \
--file "${ROOT_PATH}/build/dockerfile.${target}" \
"${ROOT_PATH}"
Expand Down

0 comments on commit 8961f8a

Please sign in to comment.