linuxserver / reverse-proxy-confs

These confs are pulled into our SWAG image: https://github.com/linuxserver/docker-swag
GNU General Public License v3.0
1.33k stars 300 forks source link

Add private docker registry #588

Closed wmutschl closed 9 months ago

wmutschl commented 1 year ago

linuxserver.io



Description

This adds a conf file to run a Docker private registry behind SWAG.

Benefits of this PR and context

Due to the changes on Docker Hub, people might be interested in hosting their own registry for containers.

How Has This Been Tested?

Works using this docker-compose file:

version: "3"

networks:
  registry_network:

services:
  swag:
    image: lscr.io/linuxserver/swag:2.6.0-ls223
    container_name: swag
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=${TIMEZONE}
      - URL=${SWAG_URL}
      - VALIDATION=${SWAG_VALIDATION}
      - DNSPLUGIN=${SWAG_DNSPLUGIN}
      - EMAIL=${EMAIL}
      - CERTPROVIDER=${SWAG_CERTPROVIDER}
    volumes:
      - ${SWAG_ROOT}:/config
    ports:
      - 443:443
      - 80:80
    restart: unless-stopped
    networks:
      - registry_network

  registry:
    image: registry:2.8.2
    container_name: registry
    volumes:
      - ${DOCKER_REGISTRY_ROOT}:/var/lib/registry
      - ${DOCKER_REGISTRY_ROOT}/auth:/auth
    environment:
      - REGISTRY_AUTH=htpasswd
      - REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm"
      - REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
    depends_on:
       - swag
    restart: always
    networks:
      - registry_network

where I have created a htpasswd using:

docker run --entrypoint htpasswd registry:2 -Bbn $registry_user $registry_pass > ${DOCKER_REGISTRY_ROOT}/auth/htpasswd

Source / References

Idea stemmed from this blog post

github-actions[bot] commented 1 year ago

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

wmutschl commented 1 year ago

So it seems there is no interest in this?

Findarato commented 1 year ago

There seams to be no one working these merges

LinuxServer-CI commented 11 months ago

This pull request has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 8 months ago

This pull request is locked due to inactivity