Skip to content

coder/kaniko: support caching ENV and ARG directives #254

Closed
coder/kaniko
#17

Description

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:

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

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions