kaniko
kaniko copied to clipboard
Bug (Misbehaviour): Kaniko doesn't make an error when file is in .dockerignore
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:
- Create any file with any content
- 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 |
|
| 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 |
|
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