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

Should not create network when running a container with network_mode: "none" #5740

Closed
ebuildy opened this issue Mar 1, 2018 · 4 comments
Closed

Comments

@ebuildy
Copy link

ebuildy commented Mar 1, 2018

Given the following docker-compose:

version: "2"

services:

  maven:
    image: maven:3.5-jdk-8
    command: "ls "
    network_mode: "none"

  http:
    image: http
    command: "ls "

Running docker-compose -p toto run --rm maven ls is creating a network Creating network "toto_default" with the default driver.

Issue: docker-compose should not create a network when running a container that has no network!

Note: I can see a network is not created if all containers have network_mode: "none"

@shin-
Copy link

shin- commented Mar 1, 2018

Your http service needs to be connected to something, hence this is working as intended.

@ebuildy
Copy link
Author

ebuildy commented Mar 1, 2018

But I want to run only maven container.

@shin-
Copy link

shin- commented Mar 1, 2018

Networks and volumes for the project are always initialized when you do docker-compose run, even if they might not be required for that specific service.

@ebuildy
Copy link
Author

ebuildy commented Mar 1, 2018

Ho I see. So it's not a good practice to "mix" containers like this in a same docker-compose. I will create a docker-compose-build.yml to store all containers without network, thanks you.

@ebuildy ebuildy closed this as completed Mar 1, 2018
milas added a commit to milas/compose that referenced this issue Feb 24, 2023
When creating files in Go, the stdlib will create (and then rapidly
delete) files ending with `-go-tmp-umask` to determine the umask
to use for permission purposes.

This can cause trouble with Live Update because the files tend to
vanish underneath it, for example.

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

No branches or pull requests

2 participants