Home Explore Blog Models CI



docker

5th chunk of `content/manuals/security/for-admins/enforce-sign-in/methods.md`
a281e6190a9ca002b06be677dee16e942d281d28374cb4370000000100000d5b
    To activate the `registry.json` file, restart Docker Desktop on the user’s machine. When Docker Desktop starts, verify that the **Sign in
    required!** prompt appears.

    In some cases, a system reboot may be necessary for the enforcement to take effect.

    > [!TIP]
    >
    > If your users have issues starting Docker Desktop after you enforce sign-in, they may need to update to the latest version.

### Option 2: Create a registry.json file when installing Docker Desktop

To create a `registry.json` file when installing Docker Desktop, use the following instructions based on your user's operating system.

{{< tabs >}}
{{< tab name="Windows" >}}

To automatically create a `registry.json` file when installing Docker Desktop,
download `Docker Desktop Installer.exe` and run one of the following commands
from the directory containing `Docker Desktop Installer.exe`. Replace `myorg`
with your organization's name. You must use lowercase letters for your
organization's name.

If you're using PowerShell:

```powershell
PS> Start-Process '.\Docker Desktop Installer.exe' -Wait 'install --allowed-org=myorg'
```

If you're using the Windows Command Prompt:

```console
C:\Users\Admin> "Docker Desktop Installer.exe" install --allowed-org=myorg
```
> [!IMPORTANT]
>
> As of Docker Desktop version 4.36 and later, you can add more than one organization to a single `registry.json` file. With Docker Desktop version 4.35 and earlier, if you add more than one organization sign-in enforcement silently fails.

{{< /tab >}}
{{< tab name="Mac" >}}

To automatically create a `registry.json` file when installing Docker Desktop,
download `Docker.dmg` and run the following commands in a terminal from the
directory containing `Docker.dmg`. Replace `myorg` with your organization's name. You must use lowercase letters for your organization's name.

```console
$ sudo hdiutil attach Docker.dmg
$ sudo /Volumes/Docker/Docker.app/Contents/MacOS/install --allowed-org=myorg
$ sudo hdiutil detach /Volumes/Docker
```

{{< /tab >}}
{{< /tabs >}}

### Option 3: Create a registry.json file using the command line

To create a `registry.json` using the command line, use the following instructions based on your user's operating system.

{{< tabs >}}
{{< tab name="Windows" >}}

To use the CLI to create a `registry.json` file, run the following PowerShell
command as an administrator and replace `myorg` with your organization's name. The file
contents are case-sensitive and you must use lowercase letters for your
organization's name.

```powershell
PS>  Set-Content /ProgramData/DockerDesktop/registry.json '{"allowedOrgs":["myorg"]}'
```

This creates the `registry.json` file at
`C:\ProgramData\DockerDesktop\registry.json` and includes the organization
information the user belongs to. Make sure that the user can't edit this file, but only the administrator can:

```console
PS C:\ProgramData\DockerDesktop> Get-Acl .\registry.json


    Directory: C:\ProgramData\DockerDesktop


Path          Owner                  Access
----          -----                  ------
registry.json BUILTIN\Administrators NT AUTHORITY\SYSTEM Allow  FullControl...
```

> [!IMPORTANT]
>
> As of Docker Desktop version 4.36 and later, you can add more than one organization to a single `registry.json` file. With Docker Desktop version 4.35 and earlier, if you add more than one organization sign-in enforcement silently fails.

Title: Creating registry.json During Installation or Via Command Line
Summary
This section details how to create the `registry.json` file during Docker Desktop installation on Windows and Mac using command-line instructions. The commands specify the organization name and are OS-specific. As of Docker Desktop version 4.36, multiple organizations can be added to the `registry.json` file, which was not supported in earlier versions. It also includes instructions on creating a registry.json file through the CLI, which creates the file with only the administrator having rights to edit the file.