#Getting an ENV to the Docker build process

1 messages · Page 1 of 1 (latest)

native schooner
#

I have the following code:

        const src = client.host().directory(project_dir).withoutDirectory('.git').withoutDirectory('./node_modules');
        src.dockerBuild(dockerBuildOpts)
            .withEnvVariable("USER",nuget_user)
            .withEnvVariable("PAT",nuget_password)
            .withRegistryAuth(registry_url, azure_user, secret)
            .publish(registry_url + registry_loc + ':' + docker_image);

However, the USER and PAT variables, don't seem to be available with the Docker file?

Any ideas?

glossy onyx
native schooner
#

I've already got them in there, they just don't seem to be available to my sed command that's running as part of my Docker file?

simple galleon
#

@native schooner ENV can't be passed as an argument to dockerfiles

#

you need to use ARG instead

#

and then set the ARGS with the method kyle referenced above in the dockerBuild method