【Dockerfile】マルチステージビルドのFROMでbuild-args変数を使う場合

最初のFROMの前にARGとして定義することでグローバル変数的に使うことができる
1 2 3 4 5 6 7 8 9 10 |
# Grobal ENV ARG DEPLOYENV FROM ${DEPLOYENV}-master:latest AS deps RUN echo aaa FROM ${DEPLOYENV}-test:latest AS chart RUN echo bbb |