Commit Graph

11 Commits

Author SHA1 Message Date
jerae-duffin fd8fa8782f
Update _includes/configure-registry-json.md 2022-08-31 16:05:56 -05:00
jerae-duffin 49d0839771
Update _includes/configure-registry-json.md
Co-authored-by: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>
2022-08-29 14:06:02 -05:00
aiordache a494c4ad96 update registry access management docs for DD4L
Signed-off-by: aiordache <anca.iordache@docker.com>
2022-08-26 17:38:27 +02:00
Justin Chadwell 4ff46f1e45 lint: header spacing rules 2022-07-28 11:27:10 +01:00
Sebastiaan van Stijn 60c89b306f
fix instructions for registry.json
The previous instructions fixed situations where the directory
and file didn't exist, but had some issues remaining;

The `>>` _appends_ the content to the file; this would work if the file didn't
exist (before `touch`'ing it) but if there happened to be a file already, it
would append the content to the existing file, resulting in invalid JSON.

e.g. running it twice (which may be accidentally);

```bash
sudo echo '{"allowedOrgs":["myorg"]}' >> "/Library/Application Support/com.docker.docker/registry.json"
sudo echo '{"allowedOrgs":["myorg"]}' >> "/Library/Application Support/com.docker.docker/registry.json"
```

Would result in;

```bash
sudo cat "/Library/Application Support/com.docker.docker/registry.json"
{"allowedOrgs":["myorg"]}
{"allowedOrgs":["myorg"]}
```

(which is invalid JSON)

The `sudo echo` also had some issues; the `sudo` only applied to the `echo`, and
not to the piped output (see https://unix.stackexchange.com/questions/1416/redirecting-stdout-to-a-file-you-dont-have-write-permission-on);

```bash
$ sudo touch "/Library/Application Support/com.docker.docker/registry.json"
$ sudo echo '{"allowedOrgs":["myorg"]}' > "/Library/Application Support/com.docker.docker/registry.json"
bash: /Library/Application Support/com.docker.docker/registry.json: Permission denied
```

Instead, using `tee` to run as privileged process, similar to the approach taken
in c33d39a7ba/engine/install/debian.md (L106)

With that, the `touch` wouldn't be needed (the `mkdir` still would though);

```suggestion
$ sudo mkdir -p "/Library/Application Support/com.docker.docker"
$ echo '{"allowedOrgs":["myorg"]}' | sudo tee "/Library/Application Support/com.docker.docker/registry.json"
```

The new instructions will always overwrite the content with the new content,
replacing what's already there (that may need a small warning / note though) to
prevent the invalid JSON if someone runs the command multiple times, or if they
have to update the existing config with a new one.

Finally, some verification steps were added to verify content and permissions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-27 22:22:18 +02:00
Craig Osterhout d306f6c19d
add quotes around directory with spaces (#15215) 2022-07-27 13:03:44 -07:00
Craig Osterhout 2e14be9598
restructured configure-registry-json (#14884)
* restructured configure-registry-json
2022-06-22 10:20:43 -07:00
Jerae Duffin 46097dd2a8 updated registry.json 2022-04-27 07:24:05 -05:00
jerae-duffin 66bc6c643e
updated registry.json (#14551)
* updated registry.json

* updated install info

* fix some formatting issues for registry.json instructions

- use `console` blocks for command-line examples
- use different prompts for "powershell" and "non-powershell" examples
- fix path of registry.json on macOS
- wrap some of the lines to ~80 chars

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-19 11:48:01 -05:00
Sebastiaan van Stijn 07ba341736
IAM: fix missing prompt, causing code to not be selectable
This code-block uses the "console" highlighting, which considers lines that do
not start with a prompt to be "output" of the command, and non-selectable.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-31 22:28:12 +02:00
Usha Mandya a166dc017d Add includes file for registry.json config
Signed-off-by: Usha Mandya <usha.mandya@docker.com>
2022-02-25 16:05:48 +00:00