Let's assume we have a Dockerfile like this:
FROM SomeBaseImage:Version ENV MyVar="MyValue" In case SomeBaseImage already has a value for MyVar, we usually copy that and set the new value in our Dockerfile. In our case we need to append to it. But this has a drawback:
In case a newer version of SomeBaseImage modifies the value of MyVar, we'll end up with a hard-coded value based on the older version.
Is there a way to access the environment variable from the base image (and then possibly append to it)?
P.S: From my understanding, Arg is not the answer. It allows access to arguments passed by the build command, not environment variables set in the base image.
没有评论:
发表评论