support using json for registry config #1680
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
envd bootstrap --registry-config path_to_json_file
Format:
![Screenshot 2023-07-03 at 3 03 15 PM](https://private-user-images.githubusercontent.com/98242479/250667817-c18425ce-c7b4-4790-8afb-6063718740f9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3Mzk5ODcsIm5iZiI6MTcyMDczOTY4NywicGF0aCI6Ii85ODI0MjQ3OS8yNTA2Njc4MTctYzE4NDI1Y2UtYzdiNC00NzkwLThhZmItNjA2MzcxODc0MGY5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzExVDIzMTQ0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVmYzY5MzdkNzhkYzJiNDZiNzZiMzhjMzE1OWExNjdlY2ViNmNiNjI5NmMwMGI2YjY4ZTU3ODBiZGQ4N2YzODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SpR8wM0VfH14OjLdGvaZRga7S5Fun8x-1O-IOBal8d4)
Note that the "name" field is required. The other fields are all optional.
This will allow users to specify private Docker registries and the respective credentials. Under the hood, we parse these credentials and create a corresponding buildkit TOML file, as well as set up Docker bindings. This enables users to pull and push images from private Docker registries.
This is also completely backwards compatible with the existing "registry" and "registry-ca-keypair" command. We check that a user only specifies "registy-config" on its own, meaning that a user can't use both registry-config and registry or both registry-config and registry-ca-keypair.
The registry-config command also enables users to specify more than one registry now. For example, if the registry you pull your image from is different than the registry you push your image to, and you need auth for both of them, you should use the registry-config command.