Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using Nexus to proxy docker hub #1089

Closed
3 of 4 tasks
dvoet opened this issue Dec 1, 2021 · 16 comments · Fixed by #2026
Closed
3 of 4 tasks

Problem using Nexus to proxy docker hub #1089

dvoet opened this issue Dec 1, 2021 · 16 comments · Fixed by #2026
Assignees
Labels
bug Something isn't working design Figure out how we should do something size/M
Milestone

Comments

@dvoet
Copy link
Contributor

dvoet commented Dec 1, 2021

Describe the bug
I am trying to setup nexus in the AzureTRE environment to proxy docker hub. I believe I have nexus setup correctly and appropriate docker hosts added the the firewall rules. When I try to run docker login from a VM running in a workspace shared service subnet I see error similar to what is described here. According to Sonatype docs docker needs to be exposed on a different port than the standard ssl port nexus is already running on. However nexus is running in an Azure App Service and I don't see a way to expose custom ports.
Steps to reproduce

  1. setup Nexus to proxy docker hub
  2. add *.docker.io and *.docker.com to firewall rules to allow nexus to access them
  3. create workspace and start vm in shared services subnet
  4. connect to vm using bastion and run docker login nexus-[tre_id].azurewebsites.net:[port]
  5. see timeout error

Acceptance criteria

@dvoet dvoet added the bug Something isn't working label Dec 1, 2021
@marrobi marrobi added this to the Release 0.3 milestone Dec 1, 2021
@marrobi marrobi changed the title [BUG] problem using Nexus to proxy docker hub Problem using Nexus to proxy docker hub Jan 11, 2022
@marrobi marrobi added size/M design Figure out how we should do something labels Jan 11, 2022
@daltskin daltskin moved this to Triage in AzureTRE - Crew Rock Jan 28, 2022
@oliver7598
Copy link
Contributor

Can this be assigned to me

@tamirkamara
Copy link
Collaborator

@oliver7598 do you have an idea on how to address this?

@oliver7598
Copy link
Contributor

@tamirkamara myself and @jjgriff93 are going to pair on this as a priority over the next sprint

@tamirkamara
Copy link
Collaborator

Sounds good. Can you please share more details on the plan once you have it?
IIRC, I was the one who added this to begin with, so let me know if there's something I can help with...

@marrobi
Copy link
Member

marrobi commented Mar 4, 2022

This doc will be useful - might be we add a second app service just for docker?

@jjgriff93
Copy link
Collaborator

Current challenge is exposing a second port in App Service to allow docker hub connections, which is prevented by this limitation: https://docs.microsoft.com/en-us/archive/blogs/waws/things-you-should-know-web-apps-and-linux#you-can-only-expose-one-port-to-the-outside-worldapplies-to-web-app-for-containers

@jjgriff93
Copy link
Collaborator

Potential solution is moving nexus to container instances which does support multiple ports, Oliver and I will do some investigation into this

@marrobi
Copy link
Member

marrobi commented Mar 8, 2022

Container instances could work, still need an SSL certificate. VM is potentially a better option - easier to mount disks, backup etc.

Either way I don't think we can avoid generating SSL certificates with ACI or a VM.

@marrobi
Copy link
Member

marrobi commented Mar 8, 2022

@jjgriff93 do you think this would work...

Create a new web app - that shares the same config and data store. The second web app exposes the docker proxy port. The first (existing web app) is used for the user interface. Not sure if that would work.

@jjgriff93
Copy link
Collaborator

We had this thought also, will require some testing as to whether Nexus would support that - I don't think we'd be able to configure anything because we couldn't post configuration to the Nexus API to set up the docker proxy if we've exposed a different port for that instance

@jjgriff93
Copy link
Collaborator

Have set up a meeting to discuss further after tomorrow's stand-up - @tamirkamara have invited you if you're able to attend as your input would be valued. If not feel free to post your thoughts on this ticket. Summary of the planned meeting discussion:

@marrobi
Copy link
Member

marrobi commented Mar 9, 2022

Scrap the multiple web app idea. The SSL certificate needs to be loaded into nexus - can't do that with web apps as we don't have access to the cert.

Could not configure HTTPS connector on port 5000 for docker repository dockerhub

Searching got me:
"Docker registries are required to use HTTPS. This message means that you have not configured Jetty with a keystore from which it can load a TLS certificate for the Docker HTTPS connectors"

I see no option that to use a trusted SSL certificate, and in that case would run in docker on a VM/VMSS.

To get a trusted SSL, either

  1. Need to procure a wildcard cert that can be used throughout the TRE (in the past has been a requirement for many production use cases).
  2. Expose an endpoint publicly, get a lets encrypt cert, then make private - messy.
  3. Use self signed certs and configure VMs to trust these certs... also not great.

@stuartleeks
Copy link
Contributor

Possible approach for working with private VM endpoint proposed by @marrobi in a discussion on this (in terms of supporting dev environments)



 ┌──────────────────────────────────────────┐    ┌────────────────────────────────┐
 │                                          │    │                                │
 │ Public IP: mytre123.uksouth.cloudapp.net │    │  Storage static site           │
 │                                          ├───►│                                │
 │                                          │    │                                │
 └──────────────────────────────────────────┘    └────────────────────────────────┘
                                                        ▲
                                                        │
                                                        │
                                                        │
                                                        │
                                                        │
 ┌──────────────────────────────────┐                   │
 │                                  ├───────────────────┘
 │  Letsencrypt cert                │
 │  processor (run on schedule)     ├────────────────────┐
 │                                  │                    │
 └──────────────────────────────────┘                    │
                                                         │       ▼
                                                         │
                                                         │
                                                         │
                                                 ┌───────▼────────────────────────┐
                                                 │                                │
                                                 │  Key Vault                     │
                                                 │                                │
                                                 └────────────────────────────────┘
                                                         ▲
                                                         │
                                                         │
                                                         │
                          ┌──────────────────────────────┼────────────────────────────────────┐
                          │                              │                                    │
                          │   VNET                       │                                    │
                          │                              │                                    │
                          │                              │                                    │
                          │                      ┌───────┴─────────────────────────────┐      │
                          │                      │                                     │      │
                          │                      │ VM                                  │      │
                          │                      │                                     │      │
                          │                      │                                     │      │
                          │                      └─────────────────────────────────────┘      │
                          │                                                                   │
                          │                                                                   │
                          │                                                                   │
                          │                      ┌─────────────────────────────────────┐      │
                          │                      │                                     │      │
                          │                      │  Private DNS Zone:                  │      │
                          │                      │  map mytre123.uksouth.cloudapp.net  │      │
                          │                      │         to VM IP address            │      │
                          │                      │                                     │      │
                          │                      │                                     │      │
                          │                      │                                     │      │
                          │                      └─────────────────────────────────────┘      │
                          │                                                                   │
                          │                                                                   │
                          │                                                                   │
                          └───────────────────────────────────────────────────────────────────┘
                          

@jjgriff93
Copy link
Collaborator

jjgriff93 commented Mar 10, 2022

Have added two new issues (see above) to start tracking the work on this

@martinpeck
Copy link
Member

The three tasks associated with this bug are close, and the PR #1584 is merged, so closing this one out.

Thanks all!

Repository owner moved this from In Progress to Done in AzureTRE - Crew Rock May 30, 2022
@jjgriff93
Copy link
Collaborator

Re-opening as #1584 was a dependency to get this one closed, but now that the dependency is in main we can configure docker hub as a repository in nexus as per this story to resolve the original issue

@jjgriff93 jjgriff93 reopened this Jun 6, 2022
@jjgriff93 jjgriff93 moved this from Done to In Progress in AzureTRE - Crew Rock Jun 6, 2022
@martinpeck martinpeck moved this from In Progress to PR in AzureTRE - Crew Rock Jun 13, 2022
Repository owner moved this from PR to Done in AzureTRE - Crew Rock Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design Figure out how we should do something size/M
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants