kaniko: yarn is missing files after container is built with kaniko
Dockerfile with yarn is missing files after container is built with kaniko, tried on 0.17.1 and 0.16.0:
FROM node:10.19.0-buster
ENV YARN_VERSION 1.22.0
# install latest yarn
RUN curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
&& ln -snf /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
&& ln -snf /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz
… now if you pull this image and cd /opt/yarn-v1.22.0/ you will notice empty folders without files.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 22 (8 by maintainers)
I indeed built my base image with docker; I’ll try building it with kaniko and report back
Thanks for testing @drptbl. I’ve never used gitlab before but I’m setting an account up now to debug this.
@cvgw
docker-node:10.19.0-busterusing kaniko, with followingDockerfile: https://gist.github.com/drptbl/3441afdf9b5821d34b8ba399c011d755example command format:
docker-e2e:10.19.0-busterusing kaniko, with followingDockerfile(it uses previous image as base, please edit): https://gist.github.com/drptbl/92b67ccffa2c14bd78b7100e9d777a24That’s it. You will get an error while building secondary image (
docker-e2e):As you can see I’m always clearing cache while trying things, so it’s not a case.
@drptbl can you provide instructions on how to build the base image in your latest example or share an example that depends on a public base image. Thanks