Build and push an image using Kaniko #3894
Unanswered
felipe-leon-NTT
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to build and push an image to ACR using GH Actions with self-hosted runners in AKS.
After some research I found out that using Docker is not a way of doing this in the context of Kubernetes so I found Kaniko. As shown in the official docs "running Kaniko in any Docker image other than the official Kaniko image is not supported" (https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#known-issues), so the only way left is to run the job in a container using the official Kaniko image. The problem here is that the official Kaniko image come only with the needed packages and binaries to run Kaniko, but in the context of a CI pipeline a lot more than the build and push stage is needed. After reaching this point I have two jobs: one for all the previous steps that run before building and pushing image, and the other one that should build and push the image with Kaniko.
This is the workflow:
Now the problem is that in the build and push job I have no the same workspace that the one in the previous job, so I tried the official GH solution for that which is using the upload-artifact and download-artifact actions. The upload-artifact action works well but when the run reach the second job and try to download the artifact the following error is returned:
It seems like Node is needed to use the download-artifact action but the Kaniko image does not come with it installed. I've tried to use the setup-node action but the same error is returned:
I have found this discussion: ##3247, but the problem here is that the commented solution is not helpful for my problem.
At this point, is there anything else to prove that I don't know about?
Beta Was this translation helpful? Give feedback.
All reactions