red888
red888

Reputation: 31520

Can I use env vars in Docker lables?

I don't want to repeat myself, can I do something like this?:

ENV VA1=sdfsdf \
    VAR2=dlksjdlfks \
    VAR3=1.2.3

......

LABEL VA1=ENV VA1 \
      VA2=ENV VA2 \
      VA3=ENV VA3 \

Upvotes: 1

Views: 37

Answers (1)

gile
gile

Reputation: 5976

It should get what you are looking for:

ENV VAR1=sdfsdf \
    VAR2=dlksjdlfks \
    VAR3=1.2.3
...
LABEL VA1=$VAR1 \
      VA2=$VAR2 \
      VA3=$VAR3

Upvotes: 2

Related Questions