openshift-pipelines / vote-api

Apache License 2.0
4 stars 945 forks source link

Image build not working #10

Open danitrod opened 3 years ago

danitrod commented 3 years ago

Running step 6 of OpenShift Pipelines tutorial on https://learn.openshift.com/middleware/pipelines/, which clones this repo and builds the image, the build fails. The error is the following:

[build-image : build] STEP 4: RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .
[build-image : build] /bin/sh: go: command not found
[build-image : build] subprocess exited with status 127
[build-image : build] subprocess exited with status 127
[build-image : build] error building at STEP "RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .": exit status 127

Looks like go isn't installed properly. Maybe I am missing something? I runned every step of the tutorial.

ibmrcruicks commented 3 years ago

imagestream is seems to be based on /bin/sh, not bash -- [[ == ]] doesn't work - [ "${GARCH}" = "x86_64" ]; is shell-neutral for string match. imagestream doesn't set PATH to include go, hence command not found using previous ubi8 image still works ...

aelsaman commented 3 years ago

+1 same error

pmmistry commented 3 years ago

Hi. - I am seeing same error with the backend service. Step 6 of 7 :


[build-image : build] Storing signatures
[build-image : build] STEP 2: WORKDIR /build
[build-image : build] STEP 3: ADD . /build/
[build-image : build] STEP 4: RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .
[build-image : build] /bin/sh: go: command not found
[build-image : build] subprocess exited with status 127
[build-image : build] subprocess exited with status 127
[build-image : build] error building at STEP "RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .": exit status 127

failed to get logs for task build-image : container step-build has failed  : [{"key":"StartedAt","value":"2021-02-24T02:52:35.359Z","resourceRef":{}}]```

how do we resolve this issue ? 
dickyhome commented 3 years ago

[build-image : build] + buildah --storage-driver=overlay bud --format=oci --tls-verify=false --no-cache -f ./Dockerfile -t image-registry.openshift-image-registry.svc:5000/pipelines-tutorial/vote-api . [build-image : build] STEP 1: FROM image-registry.openshift-image-registry.svc:5000/openshift/golang:latest AS builder [build-image : build] Getting image source signatures [build-image : build] Copying blob sha256:dcc691b92f82cdd39913b5e0015b5b648656608e0b9768aa4907a2420a0bcd03 [build-image : build] Copying blob sha256:1d72f48b3d14f64a70c8eb92dff736969b510ddcf2da89fac058c5c03ba41c58 [build-image : build] Copying blob sha256:a4d9907173f48ee257a0d6c451d530a2ec4088c38908b2ec48e3bc8dc66c6d21 [build-image : build] Copying blob sha256:8a2b38c5dec5b8ce451a3f3a29f9b52803c756a49beb04e04244c66c399ef242 [build-image : build] Copying blob sha256:506b188c0abe2ae3c1561bbff7ce50284de2a241eff5da6f528a3a024871c606 [build-image : build] Copying config sha256:2b397b46f0d6f8c0703e32687427247b582896d56ec5130c4ddc64871e49e5ac [build-image : build] Writing manifest to image destination [build-image : build] Storing signatures [build-image : build] STEP 2: WORKDIR /build [build-image : build] STEP 3: ADD . /build/ [build-image : build] STEP 4: RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server . [build-image : build] /bin/sh: go: command not found [build-image : build] subprocess exited with status 127 [build-image : build] subprocess exited with status 127 [build-image : build] STEP 5: FROM scratch [build-image : build] error building at STEP "RUN export GARCH="$(uname -m)" && if [[ ${GARCH} == "x86_64" ]]; then export GARCH="amd64"; fi && GOOS=linux GOARCH=${GARCH} CGO_ENABLED=0 go build -mod=vendor -o api-server .": exit status 127

still error in today i try this in learn.openshift.com