I am trying to build a docker image using the --build-arg flag that is available in the cli. I have tried doing
docker.buildImage(tar, {
t: 'tagname',
'build-arg' : ['NPM_TOKEN=mynpmtoken']
}, (err, output) => {
//some code
});
as well as
docker.buildImage(tar, {
t: 'tagname',
'build-arg' : 'NPM_TOKEN=mynpmtoken'
}, (err, output) => {
//some code
});
Is there any way to achieve what I am trying to do, or is this not supported?
docker-cli is also a Docker Remote API client like dockerode is, so you need to check RAPI's documentation.
https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/build-image-from-a-dockerfile
Is it supported:
buildargs – JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for command(s) run via the Dockerfile’s RUN instruction or for variable expansion in other Dockerfile instructions. This is not meant for passing secret values.
Most helpful comment
docker-cli is also a Docker Remote API client like dockerode is, so you need to check RAPI's documentation.
https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/build-image-from-a-dockerfile
Is it supported:
buildargs – JSON map of string pairs for build-time variables. Users pass these values at build-time. Docker uses the buildargs as the environment context for command(s) run via the Dockerfile’s RUN instruction or for variable expansion in other Dockerfile instructions. This is not meant for passing secret values.