Description
openedon Jun 28, 2024
Currently, when attempting to DoCacheProbe
fails when encountering ENV
directives:
#2: Using caching version of cmd: RUN cargo install exa bat ripgrep typos-cli watchexec-cli
#2: ENV CARGO_INSTALL_ROOT=/tmp/
error: get cached image: error probing build cache: uncached command *commands.EnvCommand encountered when probing cache
It looks like we need to implement the CachedExecuteCommand
interface for both ENV
and ARG
commands:
- https://github.com/coder/kaniko/blob/main/pkg/commands/cache.go#L36-L38
- https://github.com/coder/kaniko/blob/main/pkg/commands/env.go
- https://github.com/coder/kaniko/blob/main/pkg/commands/arg.go
To reproduce, here is a sample Dockerfile that fails to cache probe:
FROM alpine:latest
ENV FOO=hello
ARG BAR=world
RUN echo "$FOO $BAR" > /root/msg.txt
Alternatively, try to build the dogfood Dockerfile from coder/coder with ENVBUILDER_GET_CACHED_IMAGE=1
(assuming the image was previously built).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment