buildkit: Layer in built image is missing / empty 0B
Since upgradeing to v0.8.1 from v0.8.0, I encounter a missing layer, or at least a missing file in the built image.
When trying to start the image, it fails, because the entrypoint file is missing. I can confirm this, if I override the entrypoint and start the image, the docker-entrypoint.sh isn’t there. I could reproduce this for multiple builds in CI, after downgrading, the bug was gone.
My Dockerfile has this structure:
# Install php dependencies
FROM composer:1 AS php-dependencies
COPY composer.lock composer.json ./
RUN composer install --ignore-platform-reqs
FROM php:7.4-cli AS base
WORKDIR /application
# ... some stuff
# Configure entrypoint script
COPY dockerfiles/php/docker-entrypoint.cron.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
FROM base AS production
# Copy built dependencies and src
COPY --chown=33:33 . .
COPY --from=php-dependencies --chown=33:33 /app/vendor ./vendor
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 26 (9 by maintainers)
Commits related to this issue
- Fix issues #1980 and #2198 — committed to jgiannuzzi/buildkit by jgiannuzzi 3 years ago
- Fix issues #1980 and #2198 — committed to jgiannuzzi/buildkit by jgiannuzzi 3 years ago
- Fix issues #1980 and #2198 Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.me> — committed to jgiannuzzi/buildkit by jgiannuzzi 3 years ago
- Fix issues #1980 and #2198 Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.me> (cherry picked from commit 2c540bdc9d3c53c63afa2d3e875a2c2cb3e36bcd) — committed to tonistiigi/buildkit by jgiannuzzi 3 years ago
- Acb/update buildkit (#53) * dockerfile: fix git version detection Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> * Add support for heredocs with ONBUILD Signed-off-by: Justin Chadwell <me... — committed to earthly/buildkit-old-fork by alexcb 3 years ago
- Acb/earthly main (#54) * integration: add common context base to all integration tests Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> * vendor: update opentelemetry to 1.0.0-rc Signed-off... — committed to earthly/buildkit-old-fork by alexcb 3 years ago
- Fix issues #1980 and #2198 Signed-off-by: Jonathan Giannuzzi <jonathan@giannuzzi.me> — committed to sarahhodne/buildkit by jgiannuzzi 3 years ago
I finally got the commit! Building from dda009a58c76e3e54b4539dce23623eefcc4428c breaks the image after first cache import, 48991bf6c4f9d39f30a7795ede75871f86a4d06b does not. So it would be fixed in 0.8.2, if
v1.EmptyLayerRemovalSupportedwasfalseby default.As I already outlined above, our dockerfile contains:
So would the
RUNlayer be removed/is this layer „empty”?