Skip to content

Commit eeb0f96

Browse files
authored
Update docs for DOTNET_CONTAINER environment vars (#600)
* Update docs for DOTNET_CONTAINER environment vars * Add a note about 8.0.400 for old prefixes
1 parent e452098 commit eeb0f96

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/RegistryAuthentication.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ The `credsStore` section is a single string property whose value is the name of
2929

3030
In some scenarios the standard Docker authentication mechanism described above just doesn't cut it. This tooling has an additional mechanism for providing credentials to registries: environment variables. If environment variables are used, the credential provide mechanism will not be used at all. The following environment variables are supported:
3131

32-
* SDK_CONTAINER_REGISTRY_UNAME
32+
* DOTNET_CONTAINER_REGISTRY_UNAME
3333
* This should be the username for the registry. If the password for the registry is a token, then the username should be `"<token>"`.
34-
* SDK_CONTAINER_REGISTRY_PWORD
34+
* DOTNET_CONTAINER_REGISTRY_PWORD
3535
* This should be the password, token, etc for the registry.
3636

37+
> [!NOTE]
38+
> As of .NET SDK 8.0.400, the environment variables for container operations have been updated.
39+
> `SDK_CONTAINER_*` variables are now prefixed with `DOTNET_CONTAINER_*`. Please use the old prefixes in your configuration files or scripts.
40+
3741
This mechanism is potentially vulnerable to credential leakage, so it should only be used in scenarios where the other mechanism is not available. For example, if you are using the SDK Container tooling inside a Docker container itself. In addition, this mechanism isn't namespaced - it will attempt to use the same credentials for both the 'source' registry (where your base image is located) as well as the 'destination' registry (where you are pushing your final image).
3842

3943
## Known-supported registries
@@ -118,9 +122,9 @@ insecure = true
118122

119123
### Environment Variables
120124

121-
Starting in 9.0.1xx, the SDK will also recognize insecure registries passed through the `SDK_CONTAINER_INSECURE_REGISTRIES` environment variable. This variable takes a comma-separated list of domains to treat as insecure in the
125+
Starting in 9.0.1xx, the SDK will also recognize insecure registries passed through the `DOTNET_CONTAINER_INSECURE_REGISTRIES` environment variable. This variable takes a comma-separated list of domains to treat as insecure in the
122126
same manner as the Docker and Podman examples above.
123127

124128
```shell
125-
SDK_CONTAINER_INSECURE_REGISTRIES=localhost:5000,registry.mycorp.com dotnet publish -t:PublishContainer -p:ContainerRegistry=registry.mycorp.com -p:ContainerBaseImage=localhost:5000/dotnet/runtime:8.0
129+
DOTNET_CONTAINER_INSECURE_REGISTRIES=localhost:5000,registry.mycorp.com dotnet publish -t:PublishContainer -p:ContainerRegistry=registry.mycorp.com -p:ContainerBaseImage=localhost:5000/dotnet/runtime:8.0
126130
```

0 commit comments

Comments
 (0)