Skip to content

Define dnpublic_network in the docker-compose.yml #66

Open

Description

@pablomendezroyo

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

Activity

  1. dapplion commented on May 18, 2022

    @dapplion
    Collaborator

    @pablomendezroyo can you justify why

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

  2. pablomendezroyo commented on May 18, 2022

    @pablomendezroyo
    ContributorAuthor

    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

  3. dapplion commented on May 19, 2022

    @dapplion
    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?

  4. 3alpha commented on May 19, 2022

    @3alpha
    Member

    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.

  5. pablomendezroyo commented on May 19, 2022

    @pablomendezroyo
    ContributorAuthor

    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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions