In this example, an INTERVALARG equal to 60 would be known to the HEALTHCHECK instruction, and the --interval flag would be interpreted to be 60s.
Which service(s) is this request for?
This is applicable to Dockerfiles.
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
As shown in the example, there are HEALTCHECKCMDs that must know one or more options related to the the check. For example, in the case of logging heartbeats to file, some-command (from the example) needs to know how frequently to expect a heartbeat. This could be accomplished, according to the example, by setting an interval ARG that would be passed to the --interval flag as well as an argument to the whatever command is being executed by CMD.
Are you currently working around the issue?
Currently, the --interval flag must be set manually (in the Dockerfile, at docker run, or in docker-compose). This always requires specifying the same configuration value at least twice - once for the --interval flag and once as part of the CMD - and possibly more times (if using docker-compose for with different configurations for dev/testing/prod). This is open to user error since it's easy to forget to check that the arguments are in sync with each other.
Tell us about your request Currently, an
ARG
can be interpolated in some instructions, such as the COPY instruction. Here's an example:Currently, however, an
ARG
cannot be interpolated in theHEALTHCHECK
instruction. Here's an example:In this example, an
INTERVAL
ARG
equal to 60 would be known to theHEALTHCHECK
instruction, and the--interval
flag would be interpreted to be60s
.Which service(s) is this request for? This is applicable to Dockerfiles.
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? As shown in the example, there are
HEALTCHECK
CMD
s that must know one or more options related to the the check. For example, in the case of logging heartbeats to file,some-command
(from the example) needs to know how frequently to expect a heartbeat. This could be accomplished, according to the example, by setting an intervalARG
that would be passed to the--interval
flag as well as an argument to the whatever command is being executed byCMD
.Are you currently working around the issue? Currently, the
--interval
flag must be set manually (in the Dockerfile, at docker run, or in docker-compose). This always requires specifying the same configuration value at least twice - once for the--interval
flag and once as part of theCMD
- and possibly more times (if using docker-compose for with different configurations for dev/testing/prod). This is open to user error since it's easy to forget to check that the arguments are in sync with each other.Additional context Thanks for your consideration!