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

container isolation (docker deamon with --icc=false) #39

Open
AndreasHeine opened this issue Sep 25, 2023 · 0 comments
Open

container isolation (docker deamon with --icc=false) #39

AndreasHeine opened this issue Sep 25, 2023 · 0 comments

Comments

@AndreasHeine
Copy link
Contributor

currently if no network is specified each container automatically joins the default network.
it makes container isolation impossible!

https://github.com/apocas/dockerode-compose/blob/main/lib/services.js#L173-L182

    if (service.networks !== undefined) {
      servicesTools.buildNetworks(projectName, serviceName, service.networks, networksToAttach, opts, recipe.networks);
    } else {
      opts.HostConfig.NetworkMode = projectName + '_default';
      opts.NetworkingConfig.EndpointsConfig[projectName + '_default'] = {
        IPAMConfig: null,
        Links: null,
        Aliases: [serviceName],
      };
    }

on possible solution would be to:

services:
  container1:
    image: <some image>
    networks:
      default: {}

networks:
  default:
    external: true
    name: none

we make sure "service.networks" is not undefined and to add some speacial rule to "buildNetworks()", so if we overwrite the default the container and it will join the "none" network and would be isolated!

unfortunately i dont know if "--icc=false" is accessible via the api!?

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

1 participant