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

Define dnpublic_network in the docker-compose.yml #66

Open
pablomendezroyo opened this issue May 17, 2022 · 5 comments
Open

Define dnpublic_network in the docker-compose.yml #66

pablomendezroyo opened this issue May 17, 2022 · 5 comments
Assignees

Comments

@pablomendezroyo
Copy link
Contributor

Currently the dnpublic_network is created by the dappmanager in two cases:

This is not the best approach and should be defined in the https package docker-compose.yml.

This feature deppends on the SDK and the daappmanager allowing this compose network: dappnode/DAppNodeSDK#207

@dapplion
Copy link
Collaborator

@pablomendezroyo can you justify why

This is not the best approach and should be defined in the https package docker-compose.yml.

@pablomendezroyo
Copy link
Contributor Author

The best way of working with Docker is to use the default built-in features to avoid human errors and automate as much as possible. In this case, the dnpublic_network must exist only if the HTTPS container is present. This can easily be achieved by defining it as a docker internal network in the docker-compose.yml of the HTTPS package.

The docker-compose down will attempt to remove internal networks (must see what happens if there are still running docker containers on it).

Furthermore, the SDK should have whitelisted which docker networks are allowed (right now should be only dncore and dnpublic

@dapplion
Copy link
Collaborator

Could you do some tests to check if that would work? What happens if you uninstall the https and there's still some other package on the public network?

@3alpha
Copy link
Member

3alpha commented May 19, 2022

This is what DAppManager does when HTTPS package is installed. It must be done that way because it is only way to ensure that dnpublic_network network exists on host since it is declared as external in compose. Starting compose with external network that doesn't exists fails.

@pablomendezroyo
Copy link
Contributor Author

I think the best approach would be:

  • Declare docker internal network dnpublic_network in https compose
  • In SDK and dappmanager allow just two docker networks: dnpublic and dncore
  • When installing https package it will create the dnpublic docker network in dappnode environemt.
  • When removing https package there will be an warning like error docker network in used by other containers. The dnpublic network does not makes sense without the https container, then it should be remove the docker networ dnpublic from all the containers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants