dockerdockerfile

Dockerfile define multiple ARG arguments in a single line


Right now I am defining ARGs in my Dockerfile like this:

ARG CDN_ENDPOINT
ARG AWS_S3_BUCKET

Is there a way to define them in a single line similar to ENV to avoid creating extra layers in docker image like this:

ENV CDN_ENDPOINT=endpoint \
    AWS_S3_BUCKET=bucket

Solution

  • YES, After release 1.2.0

    Previously it was not possible and it threw the following error

    ARG requires exactly one argument definition
    

    But after release 1.2.0 it is now possible to define ARG like following

    ARG CDN_ENDPOINT \
    AWS_S3_BUCKET