From 063cff6ed6bfb08783117db973bc04a7847fe40c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 31 Oct 2021 21:10:27 -0700 Subject: [PATCH] Updated Harbor with SeaweedFS (markdown) --- Docker-Image-Registry-with-SeaweedFS.md | 114 ++++++++++++++++++++++++ Harbor-with-SeaweedFS.md | 7 -- 2 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 Docker-Image-Registry-with-SeaweedFS.md delete mode 100644 Harbor-with-SeaweedFS.md diff --git a/Docker-Image-Registry-with-SeaweedFS.md b/Docker-Image-Registry-with-SeaweedFS.md new file mode 100644 index 0000000..b2c651a --- /dev/null +++ b/Docker-Image-Registry-with-SeaweedFS.md @@ -0,0 +1,114 @@ +https://github.com/distribution/distribution is a core library for many registry operators including Docker Hub, GitHub Container Registry, GitLab Container Registry and DigitalOcean Container Registry, as well as the CNCF Harbor Project, and VMware Harbor Registry. + +There are two ways to use SeaweedFS as a storage backend: +1. Use S3 storage backend with SeaweedFS S3. +2. Use file storage backend with SeaweedFS FUSE mount. + +For better performance, using S3 API is recommended. This is because FUSE mount currently needs to save the file to a local folder, before uploading the file to SeaweedFS cluster. + +# Configure Registry to use SeaweedFS S3 +Here is an example registry configuration. If you have checked out https://github.com/distribution/distribution, save this file as `cmd/registry/config-seaweedfs.yml`. + +``` +version: 0.1 +log: + level: debug + fields: + service: registry + environment: development + hooks: + - type: mail + disabled: true + levels: + - panic + options: + smtp: + addr: mail.example.com:25 + username: mailuser + password: password + insecure: true + from: sender@example.com + to: + - errors@example.com +storage: + s3: + region: default + bucket: harbor + accesskey: any + secretkey: any + regionendpoint: http://192.168.2.4:8333 + secure: false + v4auth: true + skipverify: true + rootdirectory: "/" + delete: + enabled: true + redirect: + disable: true +http: + addr: 192.168.2.4:5000 + debug: + addr: 192.168.2.4:5001 + prometheus: + enabled: true + path: /metrics + headers: + X-Content-Type-Options: [nosniff] +redis: + addr: localhost:6379 + pool: + maxidle: 16 + maxactive: 64 + idletimeout: 300s + dialtimeout: 10ms + readtimeout: 10ms + writetimeout: 10ms +notifications: + events: + includereferences: true + endpoints: + - name: local-5003 + url: http://localhost:5003/callback + headers: + Authorization: [Bearer ] + timeout: 1s + threshold: 10 + backoff: 1s + disabled: true + - name: local-8083 + url: http://localhost:8083/callback + timeout: 1s + threshold: 10 + backoff: 1s + disabled: true +health: + storagedriver: + enabled: true + interval: 10s + threshold: 3 +``` + +# Start Registry + +``` +go cmd/registry/main.go serve cmd/registry/config-seaweedfs.yml +``` + +# Using Registry + +Very likely you need to adjust your docker daemon configuration file, assuming the IP address is `192.168.1.3`: +``` +{ + "insecure-registries":[ + "192.168.1.3:5000" + ] +} +``` + +Now you can use the harbor running in your `:5000`. + +``` +$ docker pull nginx:1.13.5-alpine +$ docker tag nginx:1.13.5-alpine 192.168.1.3:5000/nginx:1.13.5-alpine +$ docker push 192.168.1.3:5000/nginx:1.13.5-alpine +``` \ No newline at end of file diff --git a/Harbor-with-SeaweedFS.md b/Harbor-with-SeaweedFS.md deleted file mode 100644 index 62ce198..0000000 --- a/Harbor-with-SeaweedFS.md +++ /dev/null @@ -1,7 +0,0 @@ -Harbor https://github.com/goharbor/harbor is to store docker images. - -There are two ways to use SeaweedFS as a storage backend for Harbor: -1. Use Harbor S3 storage backend with SeaweedFS S3. -2. Use Harbor file storage backend with SeaweedFS FUSE mount. - -For better performance, use S3 API is recommended. This is because FUSE mount currently needs to save the file to a local folder, before uploading the file to SeaweedFS cluster.