-
QuestionI have multiple static variables which are repeating a lot between stages and I'd like to declare them in one place to make the code easier to follow. What I've triedMy current approach to copying variables between stages is ARG BUILDDIR=/mnt
FROM archlinux:base AS rootfs
ARG BUILDDIR
RUN echo Result: $BUILDDIR
# Result: /mnt
FROM scratch AS host
ARG BUILDDIR
COPY --from=rootfs / /
RUN echo Result: ${BUILDDIR}
# Result: /mnt However, this spams a lot of warning messages about missing build args:
I've also tried FROM archlinux:base AS rootfs
ENV BUILDDIR=/mnt
RUN echo Result: $BUILDDIR
# Result: /mnt
FROM scratch AS host
COPY --from=rootfs / /
RUN echo Result: ${BUILDDIR}
# Result: I know it's just a warning but I'd like to keep messages which needs attention to minimal (warnings/errors/..) Is there any other way of copying variables between stages without producing warning messages? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@flouthoc PTAL |
Beta Was this translation helpful? Give feedback.
-
Thanks this is fixed with: containers/buildah#4983, once recent buildah is vendored you will not see this warnings on globally decalared args. |
Beta Was this translation helpful? Give feedback.
Thanks this is fixed with: containers/buildah#4983, once recent buildah is vendored you will not see this warnings on globally decalared args.