zrhoffman commented on a change in pull request #5252:
URL: https://github.com/apache/trafficcontrol/pull/5252#discussion_r524736078
##########
File path: infrastructure/cdn-in-a-box/optional/vnc/Dockerfile
##########
@@ -14,15 +14,22 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-FROM docker.io/centos:7
+
+ARG CENTOS_VERSION=8
+FROM centos:${CENTOS_VERSION}
+ARG CENTOS_VERSION=8
Review comment:
It's not a duplicate `ARG`. `ARG` is the only Dockerfile instruction
that is allowed before `FROM`, and in order to pull the image
`centos:${CENTOS_VERSION}` where `CENTOS_VERSION` is a build arg, `ARG` needs
to go before `FROM`.
However, build args (unlike environment variables) are not accessible in
build stages after the one where the build arg is declared. So, in order to be
able to use `CENTOS_VERSION` *after* the `FROM` instruction, a second `ARG`
instruction is required for `CENTOS_VERSION`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]