-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
intermittent wrong architecture selected when building cross platform #3077
Comments
Any update on this problem? I'm having the same issues. |
@ricardorqr what is the base image you use and is it also building arm64 and @cvaliente do you already try custom platform flag https://github.com/GoogleContainerTools/kaniko?tab=readme-ov-file#flag---custom-platform |
Hi @prima101112 I have a Jenkins pipeline which creates a multi-architecture image using Kaniko. I'm following this tutorial: https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-multi-architecture-image.html This is my pipeline pipeline {
agent {
kubernetes {
inheritFrom 'jenkins-kaniko-tomcat'
yaml """
apiVersion: v1
kind: Pod
metadata:
name: kaniko-tomcat
namespace: jenkins
spec:
containers:
- name: awscli
image: amazon/aws-cli:latest
command:
- sleep
args:
- 99d
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker
- name: jenkins-root
mountPath: /tmp/workspace
- name: kaniko
image: gcr.io/kaniko-project/executor:debug
#image: 495633144232.dkr.ecr.us-west-2.amazonaws.com/jenkins-agent-rico:kaniko
imagePullPolicy: Always
command:
- sleep
args:
- 99d
volumeMounts:
- name: docker-config
mountPath: /kaniko/.docker
- name: jenkins-root
mountPath: /tmp/workspace
restartPolicy: Never
volumes:
- name: docker-config
configMap:
name: docker-config
- name: jenkins-root
emptyDir: {}
"""
}
}
stages {
// Other stages...
stage('Build image - arm64') {
steps {
container(name: 'kaniko') {
sh '''
/kaniko/executor --context `pwd` --verbosity trace \
--destination 123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image-arm64 \
--custom-platform linux/arm64
'''
}
}
}
stage('Build image - amd64') {
steps {
container(name: 'kaniko') {
sh '''
cd uber-cloud-tools
modified_string=$(echo "$VERSION" | tr '/' '-')
/kaniko/executor --context `pwd` --verbosity debug \
--destination 123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image-amd64 \
--custom-platform linux/amd64
'''
}
}
}
stage('Build image - multi-architecture') {
steps {
container(name: 'awscli') {
sh '''
aws ecr get-login-password --region us-east-2 | docker login --username AWS \
--password-stdin 123456789.dkr.ecr.us-east-2.amazonaws.com
docker manifest create 123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image \
123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image-arm64 \
123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image-amd64
docker manifest push 123456789.dkr.ecr.us-east-2.amazonaws.com/my-repo:$my-image
'''
}
}
}
}
} This is my Dockerfile. As you can see it is a very simple one. FROM amazoncorretto:8u342
RUN yum install -y procps && yum clean all
VOLUME ["/data"] And this is the error.
When I execute the line Would you happen to have any idea what this can be? |
Actual behavior
kaniko occasionally fails building arm64 images, but succeeds after several retries.
sometimes the build fails in this stage:
if we retry the job, it usually succeeds. Only one out of 5 times actually fails, in an otherwise identical environment.
Expected behavior
A clear and concise description of what you expected to happen.
To Reproduce
We are building two versions, one for arm64, one for amd64. the base image is provided for both architectures, we are running a simple
RUN mkdir &&cp
in the docker file.build command:
with
Additional Information
running on a gitlab cicd runner
gcr.io/kaniko-project/executor:v1.21.1-debug
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: