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
In sandboxed/hermetic environments such as Bazel, $HOME is not available. This causes builds to fail following #2727. In our case, we're just using public registries so appearently being unable to load an auth config wasn't a problem before.
Solution
Add DockerConfig and DockerAuthConfig options to ContainerRequest or FromDockerfile.
Benefit
This would simplify the upgrade/management process for users running TestContainers in sandboxed environments. It also seems more consistent with the design of the rest of the package (e.g. configuration in code vs. environment variables).
Alternatives
Testers can always set DOCKER_CONFIG or DOCKER_AUTH_CONFIG in their bash profile, but then this needs to be done on every system running the tests.
Another approach is to map a sandbox path and set DOCKER_CONFIG at runtime:
dac, err:=runfiles.Rlocation("_main/docker/.config")
iferr!=nil {
log.Fatalf("could not get absolute path to docker auth config: %v", err)
}
iferr:=os.Setenv("DOCKER_CONFIG", dac); err!=nil {
log.Fatalf("could not set DOCKER_CONFIG: %v", err)
}
But this is a bit hacky.
Would you like to help contributing this feature?
Yes
The text was updated successfully, but these errors were encountered:
Testers can always set DOCKER_CONFIG or DOCKER_AUTH_CONFIG in their bash profile, but then this needs to be done on every system running the tests.
I'd like to walk back this statement a bit. Doing this works on my system (macOS), but has broken my colleagues' ability to run our tests. One is also running macOS, another is running linux.
Problem
In sandboxed/hermetic environments such as Bazel,
$HOME
is not available. This causes builds to fail following #2727. In our case, we're just using public registries so appearently being unable to load an auth config wasn't a problem before.Solution
Add
DockerConfig
andDockerAuthConfig
options toContainerRequest
orFromDockerfile
.Benefit
This would simplify the upgrade/management process for users running TestContainers in sandboxed environments. It also seems more consistent with the design of the rest of the package (e.g. configuration in code vs. environment variables).
Alternatives
Testers can always set
DOCKER_CONFIG
orDOCKER_AUTH_CONFIG
in their bash profile, but then this needs to be done on every system running the tests.Another approach is to map a sandbox path and set
DOCKER_CONFIG
at runtime:But this is a bit hacky.
Would you like to help contributing this feature?
Yes
The text was updated successfully, but these errors were encountered: