Local docker registry access: allow insecure mode (OD-474)
Stephen S opened 4 years ago

I expected this error would show up when I tried to connect to our local self-hosted registry: http: server gave HTTP response to HTTPS client Could you implement an "insecure" mode, just like Drone does (read here) or let me know how to handle the error.

  • Stephen S changed title 4 years ago
    Previous Value Current Value
    Local registry access: allow insecure mode
    Local docker registry access: allow insecure mode
  • Stephen S commented 4 years ago

    Here is More general context on the subject.

  • Robin Shen commented 4 years ago

    OneDev simply runs specified commands on specified docker image. Tune the image to make docker client accepting insecure connections is currently outside of OneDev's scope.

  • Stephen S commented 4 years ago

    Not sure that depends on the image -- and in this case I am using a Server Shell Executor that does not rely on any image, so that's on OneDev instead. The solution is to add "insecure-registries":["{registry_IP_address}:5000"] in the daemon.json file.

  • Robin Shen commented 4 years ago

    In future versions, OneDev may add built-in steps to build/push docker images (instead of requiring user to write shell commands to do that), this will be take care of. But that is a different topic.

  • Stephen S commented 4 years ago

    So what you mean is that currently there is no solution to that (very common and annoying) issue except by using a Docker Executor and do docker-in-docker build? That is very very tricky, as you know...

  • Stephen S changed fields 4 years ago
    Name Previous Value Current Value
    Priority
    Normal
    Major
  • Stephen S changed fields 4 years ago
    Name Previous Value Current Value
    Type
    Support Request
    Improvement
  • Stephen S commented 4 years ago

    But if the Server Shell Executor can be accessed in any way from a console (eg. in Portainer, under the OneDev stack), I can take care of that myself

  • Robin Shen commented 4 years ago

    I need to set up a local docker registry to test out this. So you are running OneDev itself inside docker?

  • Stephen S commented 4 years ago

    Yes I do, more precisely: Proxmox <- LXC Container <- Docker <- OneDev

  • Stephen S commented 4 years ago

    Hi Robin, if it can help, here is the docker-compose.yml I used to setup my registry and its interface -- works great:

    version: '2.0'
    services:
      registry:
        image: registry:2
        container_name: reg
        volumes:
          - '{registry_volume}:/var/lib/registry'
        restart: unless-stopped
        labels:
          - 'com.centurylinklabs.watchtower.enable=true'
        ports:
          - 5000:5000
        networks:
          - registry-ui-net
      ui:
        image: joxit/docker-registry-ui:latest
        container_name: reg-gui
        restart: unless-stopped
        ports:
          - 5011:80
        environment:
          - REGISTRY_TITLE=Registry
          - SINGLE_REGISTRY=true
          - NGINX_PROXY_PASS_URL=http://192.168.1.46:5000
          - DELETE_IMAGES=true
        depends_on:
          - registry
        networks:
          - registry-ui-net
        labels:
          - 'com.centurylinklabs.watchtower.enable=true'
    
    networks:
      registry-ui-net:
    
  • Robin Shen commented 4 years ago

    This turns out to be pretty easy:

    Just edit /etc/docker/daemon.json of the host machine running OneDev to add the insecure registries. This works as OneDev container runs with the option -v /var/run/docker.sock:/var/run/docker/sock to delegate docker related operations to host.

    Further if you are running a job with server docker executor, OneDev will again use that option to avoid the docker-in-docker trouble, and the docker operations inside the job container will be routed back to host machine as well.

    To summarize, this setup will work both for server shell executor and server docker executor. I'd recommend to server docker executor if possible for environment isolation purpose, and it does not have the docker-in-docker issue due to using host docker facility.

  • Stephen S commented 4 years ago

    THANK YOU, I really appreciate the responsiveness of your support!

  • Robin Shen changed state to 'Closed' 4 years ago
    Previous Value Current Value
    Open
    Closed
issue 1/1
Type
Improvement
Priority
Major
Assignee
Issue Votes (0)
Watchers (3)
Reference
OD-474
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover