Skip to content
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

Feature request: Cache base image in repository #2257

Open
dbadura opened this issue Sep 20, 2022 · 0 comments
Open

Feature request: Cache base image in repository #2257

dbadura opened this issue Sep 20, 2022 · 0 comments
Labels
area/registry For all bugs having to do with pushing/pulling into registries kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@dbadura
Copy link

dbadura commented Sep 20, 2022

Actual behavior
Currently Kaniko fetch base image every time I build, even I have repository cache turn on.
This behavior heavily depends on internet speed, which can be pretty slow (e.g.: mobile internet).

There is a solution with warmer, but in our case add additional overhead which we want to bypass.
Especially that repository is used as cache.

Expected behavior
I would like to add some flag like: --cache-base-image to prevent kaniko from fetching base image every time I am building something and make kaniko to use cache from repository.

To Reproduce
Steps to reproduce the behavior:

  1. Run this script:
docker run  --publish 5000:500 --network host --rm --name registry --detach \
  registry:2 /etc/docker/registry/config.yml

PWD=$(pwd)
IP="${IP:-127.0.0.1}"
docker run -v "${PWD}":/workspace \
  --network host \
  --rm \
  eu.gcr.io/kyma-project/tpi/kaniko-executor:1.9.0-a550386f \
  --insecure \
  --skip-tls-verify \
  --verbosity debug \
  --skip-unused-stages \
  --log-format=text \
  --cache=true \
  --force \
  --destination="${IP}":5000/default-function-001-v2:5b759bc8169808cba87125ac0eceef83705f0a985f04a5f9ce4c051158d5c2c4 \
  --context=dir:///workspace

Additional Information

  • Dockerfile, can be any
ARG base_image=eu.gcr.io/kyma-project/function-runtime-python39:f94d14f3
FROM ${base_image}
USER root
ENV KUBELESS_INSTALL_VOLUME=/kubeless

COPY /src/requirements.txt $KUBELESS_INSTALL_VOLUME/requirements.txt
RUN pip install -r $KUBELESS_INSTALL_VOLUME/requirements.txt
COPY /src $KUBELESS_INSTALL_VOLUME

RUN rm -rf /etc/pip.conf

USER 1000
  • Build Context
    Please provide or clearly describe any files needed to build the Dockerfile (ADD/COPY commands)
    empty requirements.txt and handler.py with:
def main(event, context):
    return "hello world"

in src dir

  • Kaniko Image (fully qualified with digest): 1.9.0-a550386f

Triage Notes for the Maintainers

Description Yes/No
Please check if this a new feature you are proposing
Please check if the build works in docker but not in kaniko
Please check if this error is seen when you use --cache flag
Please check if your dockerfile is a multistage dockerfile
@aaron-prindle aaron-prindle added kind/feature-request area/caching For all bugs related to cache issues area/registry For all bugs having to do with pushing/pulling into registries priority/p2 High impact feature/bug. Will get a lot of users happy priority/p3 agreed that this would be good to have, but no one is available at the moment. and removed area/caching For all bugs related to cache issues priority/p2 High impact feature/bug. Will get a lot of users happy labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry For all bugs having to do with pushing/pulling into registries kind/feature-request priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

2 participants