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

Bug (Misbehaviour): Kaniko doesn't make an error when file is in .dockerignore #3416

Open
helltraitor opened this issue Feb 19, 2025 · 0 comments

Comments

@helltraitor
Copy link

helltraitor commented Feb 19, 2025

Actual behavior
When some path in .dockerignore, kaniko unable to copy file and make warning

Expected behavior
Kaniko must make an error when this occurs (same as docker build do)

To Reproduce
Steps to reproduce the behavior:

  1. Create any file with any content
  2. Add this file to .dockerignore

Additional Information

  • Dockerfile (nginx for php-fpm, no static files)
    FROM nginx:1.27.4-alpine3.21
    
    WORKDIR /var/www
    
    COPY docker/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
    
    # In case of problems, comment this line or try fix: https://github.com/GoogleContainerTools/kaniko/issues/1278
    RUN nginx -t
    
  • Build Context: repository root $CI_PROJECT_DIR (gitlab)
  • Kaniko Image: gcr.io/kaniko-project/executor:debug (perhaps the latest), from logs:
    Using docker image sha256:16b383e1c3b259d59f75a2720a45ccf15b3a716cef44c6a5c521ceb471117168 for gcr.io/kaniko-project/executor:debug with digest gcr.io/kaniko-project/executor@sha256:c3109d5926a997b100c4343944e06c6b30a6804b2f9abe0994d3de6ef92b028e
    
Description Yes/No
Please check if this a new feature you are proposing
(Yes)
Please check if the build works in docker but not in kaniko
(Yes)
Please check if this error is seen when you use --cache flag
(Unknown)
Please check if your dockerfile is a multistage dockerfile
(Yes)

Since latest bugs in kaniko, we don't use cache, I think this is not related

Additional (kaniko)

WARN[0001] No files to copy                             
INFO[0001] COPY docker/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf 
WARN[0001] No files to copy   

Additonal (docker build)

=> ERROR [nginx 3/4] COPY docker/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf                                                                                                                                                                                     0.0s
------
 > [nginx 3/4] COPY docker/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf:
------
Dockerfile:64
--------------------
  62 |     WORKDIR /var/www
  63 |
  64 | >>> COPY docker/etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
  65 |
  66 |     # In case of problems, comment this line or try fix: https://github.com/GoogleContainerTools/kaniko/issues/1278
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 30d37959-a4ef-4605-bab9-743e416d95fa::evv3njrzmhfpj09ivpftlfgi7: "/docker/etc/nginx/conf.d/default.conf": not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant