build: ignore binary into git history
This commit is contained in:
parent
8f1d453f72
commit
b1a4b2d7da
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
build/
|
@ -26,11 +26,12 @@ image_build(){
|
|||||||
|
|
||||||
|
|
||||||
printf "\n\nBuild go binary %s\n\n" "${BINARY}.${binary_suffix}"
|
printf "\n\nBuild go binary %s\n\n" "${BINARY}.${binary_suffix}"
|
||||||
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -a ${GOTAGS} -o "${BINARY}.${binary_suffix}" ./cmd/${BINARY}/
|
mkdir -p build
|
||||||
|
CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -mod vendor -a ${GOTAGS} -o "build/${BINARY}.${binary_suffix}" ./cmd/${BINARY}/
|
||||||
|
|
||||||
buildah --os "$GOOS" --arch "$GOARCH" $VARIANT --name "$containerName" from gcr.io/distroless/static
|
buildah --os "$GOOS" --arch "$GOARCH" $VARIANT --name "$containerName" from gcr.io/distroless/static
|
||||||
buildah config --user 1234 "$containerName"
|
buildah config --user 1234 "$containerName"
|
||||||
buildah copy "$containerName" "${BINARY}.${binary_suffix}" /go/bin/$BINARY
|
buildah copy "$containerName" "build/${BINARY}.${binary_suffix}" /go/bin/$BINARY
|
||||||
buildah config --entrypoint '["/go/bin/'$BINARY'"]' "${containerName}"
|
buildah config --entrypoint '["/go/bin/'$BINARY'"]' "${containerName}"
|
||||||
|
|
||||||
buildah commit --rm --manifest $IMAGE_NAME "${containerName}" "${containerName}"
|
buildah commit --rm --manifest $IMAGE_NAME "${containerName}" "${containerName}"
|
||||||
|
Loading…
Reference in New Issue
Block a user