Baoyuantop commented on issue #12705:
URL: https://github.com/apache/apisix/issues/12705#issuecomment-3520070537

   1. Download the 2.14.0 online installer 
https://github.com/goharbor/harbor/releases
   2. Adjust the hostname in harbor.yml to my local IP address `192.168.31.149`
   3. Execute install.sh to start the service
   4. Launch the latest version of APISIX and use the following configuration.
   ```
   routes:
     - uri: /*
       name: docker-registry
       methods:
         - GET
         - PUT
         - POST
         - PATCH
         - HEAD
         - DELETE
       upstream:
         type: roundrobin
         nodes:
           "192.168.31.149:80": 1
       plugins:
         proxy-rewrite:
           headers:
             set:
               Host: "192.168.31.149"
               X-Forwarded-Host: "127.0.0.1:9080"
               X-Forwarded-Proto: "http"
         serverless-post-function:
           phase: header_filter
           functions:
             - |
               return function()
                 local loc = ngx.header['Location']
                 if loc then
                   loc = loc:gsub('http://192%.168%.31%.149', 
'http://127.0.0.1:9080')
                   loc = loc:gsub('http://127%.0%.0%.1/', 
'http://127.0.0.1:9080/')
                   ngx.header['Location'] = loc
                 end
                 local auth = ngx.header['WWW%-Authenticate']
                 if auth then
                   auth = auth:gsub('http://192%.168%.31%.149', 
'http://127.0.0.1:9080')
                   ngx.header['WWW-Authenticate'] = auth
                 end
               end
           
   #END
   
   ```
   
   5. docker login http://127.0.0.1:9080
   6. docker tag ubuntu:latest http://127.0.0.1:9080/library/ubuntu:latest
   7. docker push 127.0.0.1:9080/library/ubuntu:latest
   
   ```
   The push refers to repository [127.0.0.1:9080/library/ubuntu]
   ab34259f9ca5: Pushed 
   latest: digest: 
sha256:42d298b1504b9192b3b3564916ab544e9c09410280639ed4cfbc7269e3c9887f size: 
529
   ```
   
   It appears that the image can be pushed normally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to