Actual behavior
I have created my own docker image based on ubuntu with kaniko executor inside.
When I am trying to build Dockerfile based on linux alpine, the kaniko build failed with the following error: "/bin/sh: 1: apk: not found"
Expected behavior
Kaniko must be able to build images based on dockerfile using alpine image as based
To Reproduce
Steps to reproduce the behavior:
Create your own ubuntu container where to run kaniko.
I have used the following dockerfile:
FROM gcr.io/kaniko-project/executor:v1.23.0 as kaniko
FROM ubuntu:22.04
ENV JAVA_OPTS -XX:-UsePerfData
RUN apt-get update && apt-get install -y vim
WORKDIR /kaniko
USER root
COPY --from=kaniko /kaniko /kaniko
RUN cp /kaniko/executor /kaniko/kanikoexecutor
COPY config.json /kaniko/.docker/
ENV HOME /root
ENV USER root
ENV PATH=$PATH:/kaniko
ENV DOCKER_CONFIG=/kaniko/.docker/
ENV SSL_CERT_DIR=/kaniko/ssl/certs
Actual behavior I have created my own docker image based on ubuntu with kaniko executor inside. When I am trying to build Dockerfile based on linux alpine, the kaniko build failed with the following error: "/bin/sh: 1: apk: not found"
Expected behavior Kaniko must be able to build images based on dockerfile using alpine image as based
To Reproduce Steps to reproduce the behavior:
ENV JAVA_OPTS -XX:-UsePerfData
RUN apt-get update && apt-get install -y vim
WORKDIR /kaniko USER root COPY --from=kaniko /kaniko /kaniko RUN cp /kaniko/executor /kaniko/kanikoexecutor COPY config.json /kaniko/.docker/
ENV HOME /root ENV USER root ENV PATH=$PATH:/kaniko ENV DOCKER_CONFIG=/kaniko/.docker/ ENV SSL_CERT_DIR=/kaniko/ssl/certs
RUN echo '#!/bin/bash \n kanikoexecutor --ignore-path=/opt "$@"' > /kaniko/kaniko-executor && chmod +x /kaniko/kaniko-executor
RUN echo 'FROM node:lts-alpine3.18 AS deps \n RUN apk add --no-cache libc6-compat yarn' >> Dockerfile
Additional Information
Kaniko Image (fully qualified with digest)
Triage Notes for the Maintainers
--cache
flag