Docker insecure-registries only showing in sudo docker info

65 Views Asked by At

some help would be appreciated.

I run a server and am running a docker-registry that I'm trying to push/pull to from my local device. My local device is configured as per:

  1. sudo vim /etc/hosts of your local device and add a new entry:

    # Manually added for server Docker registry
    <server_ip>     nuc
    
  2. ping nuc to ensure connection.

  3. sudo vim /etc/docker/daemon.json

    {
        "insecure-registries": ["nuc:5000"]
    }
    
  4. Edit sudo vim /etc/default/docker

    {
        # Use DOCKER_OPTS to modify the daemon startup options.
        DOCKER_OPTS="--insecure-registry=nuc:5000"
    }
    

The issue I get is that when running docker info the specified insecure-registry isn't listed, however, when I run sudo docker info it is listed. Please note that my current $USER is part of the docker group and I can run docker commands without needing to use sudo (the following was followed: Docker post-install steps).

Note I got inspiration from StackOverflow at:

Any help and guidance would be greatly appreciated.

EDIT: Additional info

  • docker context ls

    NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                KUBERNETES ENDPOINT   ORCHESTRATOR
    default             moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                                          
    desktop-linux *     moby                Docker Desktop                            unix:///home/ben/.docker/desktop/docker.sock
    
  • sudo docker context ls

    NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT               KUBERNETES ENDPOINT   ORCHESTRATOR
    default *           moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock  
    
  • printenv DOCKER_HOST and echo $DOCKER_HOST returned with nothing

  • sudo printenv DOCKER_HOST and sudo echo $DOCKER_HOST returned with nothing

1

There are 1 best solutions below

3
BMitch On BEST ANSWER

From the docker context output, it appears that you have two separate docker engines. One is installed directly on the host, running as root, and listening on /var/run/docker.sock. The other engine is running inside of a VM with Docker Desktop.

The documentation for Desktop on Linux specifies their own config file location at ~/.docker/desktop/settings.json, and there should also be a UI for updating its insecure-registries setting.