Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

feature: dfdaemon supports proxing https registries #410

Merged
merged 1 commit into from
Feb 25, 2019

Conversation

lowzj
Copy link
Member

@lowzj lowzj commented Feb 21, 2019

Signed-off-by: lowzj [email protected]


Ⅰ. Describe what this PR did

This pull request implements a way to support registries which use https schema in dfdaemon's proxy pattern:

  • configure docker daemon
    • set dfdaemon host as http_proxy
    • set your registry hosts as insecure-registries
    • bypass proxy for your registry auth hosts
  • dfdaemon get the http requests, change them to https schema and send https request to the real registries

Ⅱ. Does this pull request fix one issue?

fixes #205
related #347

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Here's a example to pull images from a https registry(registry.cn-hangzhou.aliyuncs.com) by using proxy pattern:

  • create dfdaemon's config file: /etc/dragonfly/dfdaemon.yml, and start dfdaemon
    registries:
        - regx: "^registry.cn-hangzhou.aliyuncs.com$"
          schema: https
          host: registry.cn-hangzhou.aliyuncs.com
  • change your docker daemon config file: /etc/docker/daemon.json, and restart docker daemon
    {
        "insecure-registries" : [
            "registry.cn-hangzhou.aliyuncs.com"
        ],
        "proxies": {
            "default": {
                "httpProxy": "http://127.0.0.1:65001",
            }
        }
    }
  • pull a image by dragonfly
    docker pull registry.cn-hangzhou.aliyuncs.com/dragonflyoss/supernode:0.2.1

Ⅴ. Special notes for reviews

@starnop @godliness

@codecov-io
Copy link

codecov-io commented Feb 21, 2019

Codecov Report

Merging #410 into master will increase coverage by 0.78%.
The diff coverage is 95.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #410      +/-   ##
==========================================
+ Coverage      67%   67.79%   +0.78%     
==========================================
  Files          50       51       +1     
  Lines        2243     2304      +61     
==========================================
+ Hits         1503     1562      +59     
- Misses        669      671       +2     
  Partials       71       71
Impacted Files Coverage Δ
dfget/config/config.go 84.84% <ø> (ø) ⬆️
dfdaemon/muxconf/muxconf.go 100% <100%> (ø) ⬆️
dfdaemon/global/global.go 92.3% <50%> (ø) ⬆️
dfdaemon/config/config.go 96.72% <96.72%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 73bf54d...97a1cdc. Read the comment docs.

@lowzj lowzj force-pushed the dfdaemon-https-proxy branch from fe6a79a to 63b7c8a Compare February 21, 2019 08:28
@lowzj lowzj mentioned this pull request Feb 21, 2019
16 tasks
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch 2 times, most recently from 5747620 to b112147 Compare February 22, 2019 01:51
@starnop starnop changed the title feature: dfdaemon supports proxing https registries [WIP] feature: dfdaemon supports proxing https registries Feb 22, 2019
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch from b112147 to fb70824 Compare February 22, 2019 09:55
@pouchrobot pouchrobot added size/XL and removed size/M labels Feb 22, 2019
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch 3 times, most recently from 842ae92 to e24ddad Compare February 22, 2019 13:11
@lowzj lowzj changed the title [WIP] feature: dfdaemon supports proxing https registries feature: dfdaemon supports proxing https registries Feb 22, 2019
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch 2 times, most recently from 6a82db0 to 54f6dc5 Compare February 22, 2019 13:59
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch from 54f6dc5 to f15d0e9 Compare February 25, 2019 02:30
@lowzj lowzj force-pushed the dfdaemon-https-proxy branch from f15d0e9 to 93b8030 Compare February 25, 2019 04:33
@godliness
Copy link
Contributor

LGTM

@lowzj lowzj force-pushed the dfdaemon-https-proxy branch 4 times, most recently from fc8c0f4 to e81174e Compare February 25, 2019 11:44

// Properties holds all configurable properties of dfdaemon.
// The default path is '/etc/dragonfly/dfdaemon.yml'
type Properties struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write a demo here and update the docs ASAP.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have add an example here.

@starnop
Copy link
Contributor

starnop commented Feb 25, 2019

LGTM.

@lowzj lowzj force-pushed the dfdaemon-https-proxy branch from e81174e to 97a1cdc Compare February 25, 2019 12:40
@starnop starnop merged commit f7d5ffb into dragonflyoss:master Feb 25, 2019
@lowzj lowzj deleted the dfdaemon-https-proxy branch February 25, 2019 12:47
starnop added a commit to starnop/Dragonfly that referenced this pull request Nov 27, 2019
feature: dfdaemon supports proxing https registries
inoc603 pushed a commit to inoc603/Dragonfly that referenced this pull request Dec 23, 2019
feature: dfdaemon supports proxing https registries
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] dfdaemon support private registry with HTTPS protocol
5 participants