How to make a build arg mandatory during Docker build?

I tested with RUN test -n <ARGvariablename> what @konradstrack mentioned in the original (edit) post… that seems do the job of mandating the variable to be passed as the build time argument for the docker build command:

FROM ubuntu

ARG MY_VARIABLE
RUN test -n "$MY_VARIABLE"
ENV MY_VARIABLE $MY_VARIABLE

Leave a Comment

error code: 521