You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

如何在Windows Server 2019环境下配置Docker(含17.10 EE Preview 3版本)访问非安全私有镜像仓库?

Fixing Non-Secure Private Registry Connection on Windows Server 2019 (Docker 17.10 EE Preview 3)

I’ve tackled this exact issue with Docker EE on Windows Server before, so let’s break down the steps to get your insecure registry working properly—since just creating a daemon.json might not have been enough if it’s in the wrong spot or formatted incorrectly.

Step 1: Verify the Correct daemon.json Location & Content

Docker EE on Windows Server expects the daemon.json file in this exact path:

C:\ProgramData\docker\config\daemon.json

If the config folder doesn’t exist under C:\ProgramData\docker, create it first. Then populate the file with this syntax (replace your-registry-url:port with your actual registry address, e.g., 192.168.1.100:5000):

{
  "insecure-registries": ["your-registry-url:port"]
}

⚠️ Important: Make sure you’re using English quotation marks and there are no trailing commas (JSON is strict about syntax). A single typo here will cause the Docker daemon to ignore the file.

Step 2: Restart the Docker Service (Critical!)

Creating or editing daemon.json won’t take effect until you restart the Docker service. Open an elevated PowerShell (Run as Administrator) and run these commands:

# Stop the Docker service
Stop-Service docker

# Wait a few seconds for it to fully stop, then restart
Start-Service docker

# Verify the service is running
Get-Service docker

You should see Status: Running in the output.

Step 3: Confirm the Configuration Loaded

To check if Docker picked up the insecure registry setting, run:

docker info

Scroll through the output until you find the Insecure Registries section—your registry URL should be listed here. If it’s not, double-check the daemon.json path and syntax, then restart the service again.

Step 4: Handle Docker for Windows (Docker Desktop) Conflicts

You mentioned you also have Docker for Windows 2019 deployed. Note that Docker EE and Docker Desktop run as separate environments with their own configurations. If you’re using Docker Desktop instead of the EE daemon, you need to configure it through the GUI:

  • Right-click the Docker icon in the system tray → Settings
  • Go to the Docker Engine tab
  • Add the insecure-registries line to the JSON config (same syntax as above)
  • Click Apply & Restart

Step 5: Test the Connection

Once the configuration is loaded, test pulling an image from your private registry to confirm it works:

docker pull your-registry-url:port/your-image-name:tag

If this still fails, check:

  • Your firewall allows traffic to/from the registry port
  • The private registry is running and reachable from the server
  • You’re using the correct registry URL (including port if it’s not 80/443)

内容的提问来源于stack exchange,提问作者Boanerge

火山引擎 最新活动