Comments (7)
When using Kaniko you don't have to list the images in the build's images
field since Kaniko already pushes them itself.
That error message indicates the build environment doesn't have those images locally so it can't push them, because Kaniko already pushed them directly, skipping local storage.
from cloud-builders-community.
I'm working on adding this now, since other users of Kaniko have also previously asked. No definite timeline, but it's on my radar.
from cloud-builders-community.
^ same I just ran into this issue and found this issue.
from cloud-builders-community.
I'll make sure we document this better since it can definitely be confusing.
from cloud-builders-community.
Thanks for coming back so quickly @imjasonh
Is there a way to inform cloudbuild that these images were produced so they'll show up as image artifacts in the cloudbuild history?
from cloud-builders-community.
@imjasonh Any update regarding this? It is frustrating not having it displayed in the dashboard
from cloud-builders-community.
I just ran into this as well. For future folks who want kaniko builds to display nicely in the Google Cloud dashboard, I came up with this very hacky solution:
steps:
# Build with kaniko.
- name: gcr.io/kaniko-project/executor:latest
args: [--destination=$_IMAGE/kaniko:$COMMIT_SHA, --cache=true]
# Hacky docker stuff so we can get build info.
- name: docker
args: [pull, $_IMAGE/kaniko:$COMMIT_SHA]
- name: docker
args: [tag, $_IMAGE/kaniko:$COMMIT_SHA, $_IMAGE:$COMMIT_SHA]
- name: docker
args: [push, $_IMAGE:$COMMIT_SHA]
# Deploy.
- name: gcr.io/cloud-builders/gcloud
args: [run, deploy, my-service, --image=$_IMAGE:$COMMIT_SHA]
substitutions:
_IMAGE: my-image-name
images: [$_IMAGE:$COMMIT_SHA]
Explanation:
- We need the
images
field to be set so we can see it nicely in the dashboard. - That means we need the image to be present locally, because as mentioned above Cloud Build will try to push this image and kaniko did not leave it present in local storage. So we pull it with
docker pull
. - Now the weirdest (to me) part: if you
docker pull
and thendocker push
the image that kaniko built, you will get a different image digest, and so it will still not show up nicely in the dashboard. I'm very confused about this, but you can work around it thusly: - Use
docker tag
to rename the image. kaniko will manipulate images named$_IMAGE/kaniko
, but from Cloud Build's perspective you end up with just$_IMAGE
.
Note that depending on your purposes, you may be able to simplify this. For example if you don't need to immediately deploy to Cloud Run or whatever, you can probably skip the docker push
step, since images
will do that for you:
steps:
# Build with kaniko.
- name: gcr.io/kaniko-project/executor:latest
args: [--destination=$_IMAGE/kaniko:$COMMIT_SHA, --cache=true]
# Hacky docker stuff so we can get build info.
- name: docker
args: [pull, $_IMAGE/kaniko:$COMMIT_SHA]
- name: docker
args: [tag, $_IMAGE/kaniko:$COMMIT_SHA, $_IMAGE:$COMMIT_SHA]
substitutions:
_IMAGE: my-image-name
images: [$_IMAGE:$COMMIT_SHA]
And you might also be able to skip the renaming step, if you understand what's going on here better than I do.
Hope this helps!
from cloud-builders-community.
Related Issues (20)
- Windows Builder Error "The system cannot find the path specified" HOT 8
- gcr.io/cloud-builders-community/ng - BUILD FAILURE HOT 3
- Crypto token
- Cloud build with source repositories - mirror github repo containing git lfs files
- cloudbuild-ndk.yaml using NDK that hasn't been supported since 2018 HOT 1
- Using secrets from GCP Secret Manager in Helm GCP Cloud Builder HOT 1
- Build fails on image push - Repository "gcr.io" not found HOT 1
- "Error: Not in a Firebase app directory (could not locate firebase.json)", but it is there?¿
- I can not deploy specified hosting target
- ?? What do i do HOT 1
- Slackbot integration documentation not completed HOT 1
- Helm version bump HOT 2
- entrypoint.bash is non-compliant with Shell Style Guide
- docker-compoose builder fail on docker-compose version above 2
- envsubst won't substitute secrets HOT 2
- [Feature request] envsubst: support passing -s multiple times
- Cloud Build: Firebase application deployment failed due to the experimental web framework not being enabled. HOT 2
- Can not build image with packer HOT 5
- Gcloud builds submit fails with "gcr.io/$PROJECT_ID/helm" HOT 1
- Add `apt` Cloud Builder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-builders-community.