Skip to main content
added 299 characters in body
Source Link
Maroun
  • 96.3k
  • 30
  • 195
  • 249

ARG values won't be available after the image is built, so a running container won’t have access to those values. YouTo dynamically set an env variable, you can usecombine both ENVARG and have something likeENV (since ENV can't be overridden):

ARG PATH ENV P=${PATH} CMD target/universal/rule_engine-1.0/bin/rule_engine -Dconfig.file=$P 

For further explanation, I recommend this article, which explains the difference between ARG and ENV in a clear way:

enter image description here

As you can see from the above image, the ARG values are available only during the image build.

ARG values won't be available after the image is built, so a running container won’t have access to those values. You can use ENV and have something like:

ARG PATH ENV P=${PATH} CMD target/universal/rule_engine-1.0/bin/rule_engine -Dconfig.file=$P 

ARG values won't be available after the image is built, so a running container won’t have access to those values. To dynamically set an env variable, you can combine both ARG and ENV (since ENV can't be overridden):

ARG PATH ENV P=${PATH} CMD target/universal/rule_engine-1.0/bin/rule_engine -Dconfig.file=$P 

For further explanation, I recommend this article, which explains the difference between ARG and ENV in a clear way:

enter image description here

As you can see from the above image, the ARG values are available only during the image build.

Source Link
Maroun
  • 96.3k
  • 30
  • 195
  • 249

ARG values won't be available after the image is built, so a running container won’t have access to those values. You can use ENV and have something like:

ARG PATH ENV P=${PATH} CMD target/universal/rule_engine-1.0/bin/rule_engine -Dconfig.file=$P