Kaniko Container down after kaniko executor

125 views
Skip to first unread message

Ashutosh Behera

unread,
Mar 16, 2024, 1:01:20 PM3/16/24
to kaniko-users
I am having 4 stages in my jenkins file & jenkins slave agent has been configured to use kaniko .
1st stage clone the repo
2nd stage build the application
3rd stage dockerize the application
4th stage deploy to aws ecs

in 3rd stage after kaniko executor ,container is getting down  : /kaniko/executor --context `pwd` --ignore-path=/var/mail --ignore-path=/var/spool/mail --use-new-run --dockerfile=$dockerFilePath --destination=$dockerImageName

does its like , after kaniko executor pushes the image to desntiation , then kills ?

Sacha Smart

unread,
Mar 24, 2024, 6:26:57 PM3/24/24
to kaniko-users
Not sure if I completely understand the question - but in my experience with using Kaniko in a Jenkins pipelines is the Jenkins controller creates a pod, which can have a kaniko container. This kaniko container can the pull/push cache, build, and push the image. Upon completion of that step/stage, the Jenkins controller will spin down that pod as its no longer necessary. 

Ashutosh Behera

unread,
Mar 25, 2024, 12:33:58 AM3/25/24
to kaniko-users
Thanks for the reply , you can see my kaniko dockerfile to be used by jenkins controller to create container , 
can you rectify me or share me a correct dockerfile if there with you 


FROM jenkins/inbound-agent:latest-alpine
USER root

RUN apk --update add \
bash \
curl \
git \
jq \
unzip \
npm \
gradle \
maven

#
# Add kaniko to this image by re-using binaries and steps from official image
#
COPY --from=kaniko /kaniko/ /kaniko/

ENV SSL_CERT_DIR /kaniko/ssl/certs
ENV PATH $PATH:/usr/local/bin:/kaniko
ENV DOCKER_CONFIG /kaniko/.docker/
# ENV DOCKER_CREDENTIAL_GCR_CONFIG /kaniko/.config/gcloud/docker_credential_gcr_config.json
ENV AWS_SDK_LOAD_CONFIG true
ENV AWS_EC2_METADATA_DISABLED true
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && ./aws/install

# COPY files/Dockerfile.example /home/Dockerfile
# COPY execute.sh /home/execute.sh
COPY config.json /root/.docker/config.json
# RUN chmod 755 /home/execute.sh /home/Dockerfile /root/.docker/config.json
RUN chmod 755 /root/.docker/config.json

USER root

Reply all
Reply to author
Forward
0 new messages