You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we set the variable for docker CLI, we get, for example:
DOCKER_CONFIG=~/.docker terraform apply
Error: Error loading registry auth config: could not read and load config file: read /Users/atz/.docker: is a directory
│
│ with provider["registry.terraform.io/kreuzwerker/docker"],
But if we set it for TF provider, we break CLI auth.
DOCKER_CONFIG=~/.docker/config.json docker pull docker-proxy.examplecorp.io/nginx:latest
WARNING: Error loading config file: /Users/atz/.docker/config.json: open /Users/atz/.docker/config.json: not a directory
To be clear, each tool "works", within its own documented (subtly divergent) expectations. But it is unreasonable to expect developers who are working with docker every day to toggle DOCKER_CONFIG between the directory and the path values.
Possible solutions
Ideally, this provider would adopt the docker semantics for DOCKER_CONFIG in its next major version. That might be too fast for SemVer, in which case the release methodology would be:
next major version:
add two different (non-colliding) variables:
one that behaves like DOCKER_CONFIG does today (full filepath), say KW_DOCKER_CONFIG_JSON
another that behaves like CLI expects (directory containing config.json), say KW_DOCKER_CONFIG
add support for DOCKER_CONFIG pointing to directory containing config.json
add deprecation warning that fires when DOCKER_CONFIG points to a file instead of a dir
document priority of vars
subsequent major version:
convert DOCKER_CONFIG to "directory only"
optionally, deprecate the KW_ vars
At a minimum, the current incompatibility between DOCKER_CONFIG semantics should be boldly documented.
The text was updated successfully, but these errors were encountered:
Community Note
Terraform (and docker Provider) Version
Affected Resource(s)
Expected Behaviour
TF provider and
docker
CLI commands should interpretDOCKER_CONFIG
the same way (or at least, in compatible ways).Actual Behaviour
config.json
file, vs.config.json
or equivalentIf we set the variable for docker CLI, we get, for example:
But if we set it for TF provider, we break CLI auth.
DOCKER_CONFIG=~/.docker/config.json docker pull docker-proxy.examplecorp.io/nginx:latest WARNING: Error loading config file: /Users/atz/.docker/config.json: open /Users/atz/.docker/config.json: not a directory
To be clear, each tool "works", within its own documented (subtly divergent) expectations. But it is unreasonable to expect developers who are working with docker every day to toggle DOCKER_CONFIG between the directory and the path values.
Possible solutions
Ideally, this provider would adopt the docker semantics for
DOCKER_CONFIG
in its next major version. That might be too fast for SemVer, in which case the release methodology would be:DOCKER_CONFIG
does today (full filepath), sayKW_DOCKER_CONFIG_JSON
config.json
), sayKW_DOCKER_CONFIG
DOCKER_CONFIG
pointing to directory containingconfig.json
DOCKER_CONFIG
points to a file instead of a dirDOCKER_CONFIG
to "directory only"KW_
varsAt a minimum, the current incompatibility between
DOCKER_CONFIG
semantics should be boldly documented.The text was updated successfully, but these errors were encountered: