# Why does my template build fail with a Docker push authentication error? (/docs/faq/docker-push-authentication-error)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 344 · updated: 2026-07-30 -->
Related: [How do I increase my concurrency limit?](/docs/faq/increase-concurrency.md), [Do paused sandboxes count toward the concurrency limit?](/docs/faq/paused-sandboxes-concurrency.md), [Is there a limit on how many templates I can create?](/docs/faq/template-limit.md), [Can I make a template public so other projects can use it?](/docs/faq/public-templates.md), [Can I run sandboxes in the EU?](/docs/faq/eu-region.md), [Why does iptables fail with 'xt_owner module missing' in a sandbox?](/docs/faq/iptables-xt-owner.md)

When the CLI pushes a Docker image to the build registry, you may hit an authentication error because Docker doesn't send any credentials to the registry. The fix is to mark E2B's local registry proxy as an insecure registry so Docker routes through it.

## macOS [#macos]

1. Open Docker Desktop.
2. Go to **Settings**.
3. Go to **Docker Engine**.
4. Add the following line to the JSON configuration:

```json
{
  "insecure-registries": ["host.docker.internal:49984"]
}
```

A full configuration may look like this:

```json
{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "features": {
    "buildkit": true
  },
  "insecure-registries": [
    "host.docker.internal:49984"
  ]
}
```

This allows Docker to send requests to the local proxy, which handles the authentication.

5. Click **Apply & Restart**.

## Linux [#linux]

1. Edit the Docker configuration file (usually `/etc/docker/daemon.json`). Create it if it doesn't exist, and add:

```json
{
  "insecure-registries": ["localhost:49984"]
}
```

2. Restart Docker:

```bash
sudo systemctl restart docker
```

## Windows [#windows]

1. Open Docker Desktop.
2. Go to **Settings**.
3. Go to **Docker Engine**.
4. Add the following line to the JSON configuration:

```json
{
  "insecure-registries": ["host.docker.internal:49984"]
}
```

5. Click **Apply & Restart**.
