1

New to the world of docker, my dockerfile looks like this:

FROM base
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV NPM_VERSION=6.4.1 \
    IONIC_VERSION=3.19.0 \
    CORDOVA_VERSION=9.0.0 \

# Install NuGet CLI
ENV NUGET_VERSION=4.7.0

It looks like I'm specifying the env variables correctly with name=value...is this a red herring? What looks wrong here?

Adam Weitzman
  • 1,402
  • 4
  • 17
  • 43

2 Answers2

1

You can try

ENV NPM_VERSION=6.4.1
ENV IONIC_VERSION=3.19.0 
ENV CORDOVA_VERSION=9.0.0

or

ENV NPM_VERSION=6.4.1 IONIC_VERSION=3.19.0 CORDOVA_VERSION=9.0.0

I think multiple env variables with new lines are not valid syntax.

Emma
  • 2,572
  • 1
  • 11
  • 27
  • Multiple env variables with new lines *are* valid syntax, but the last line must not end with a backslash – sryll Mar 19 '21 at 12:00
1

You can use multiple ENV but not necessory. docker do support new lines

ENV NPM_VERSION=6.4.1 \
    IONIC_VERSION=3.19.0 \
    CORDOVA_VERSION=9.0.0 \ #you get extra \ here

should be

ENV NPM_VERSION=6.4.1 \
    IONIC_VERSION=3.19.0 \
    CORDOVA_VERSION=9.0.0
lzq179
  • 43
  • 6