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

Unable to recreate container with network type container:<name> that was on bridge network #2316

Closed
twigley opened this issue Sep 30, 2018 · 15 comments

Comments

@twigley
Copy link

twigley commented Sep 30, 2018

Bug description

When recreating a container that was previously on the bridge with mapped ports and changing the network to container: the following error shows:

"conflicting options: port exposing and the container type network mode"

Expected behavior
The container to have been recreated sharing the network stack of the other container specified.

Steps to reproduce the issue:

Steps to reproduce the behavior:

  1. Create 2 containers A and B on the bridge network with mapped ports
  2. Recreate B while removing the exposed ports but setting the network to "container:A"
  3. See error

Technical details:

  • Portainer version: 1.19.2
  • Docker version (managed by Portainer): 18.06.1-ce
  • Platform (windows/linux): linux
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer):
    docker run --restart always -d -p 9000:9000 -v /mnt/path/portainer/:/data -v /var/run/docker.sock:/var/run/docker.sock --name portainer portainer/portainer:latest
  • Browser:

Additional context
I've made sure in the UI at least that any mention of port exposing or port mapping is off.

@deviantony deviantony added this to Needs triage in Bug triage via automation Oct 2, 2018
@deviantony deviantony removed this from Needs triage in Bug triage Oct 2, 2018
@stevensbkang stevensbkang added this to Needs confirmation in Bug triage via automation Oct 2, 2018
@CatFoxVoyager
Copy link

Yeah, I have this issue too. Cannot set network to container. But if I do it in cli, it run perfectly

@agster27
Copy link

I have the exact same issue as well.

@deviantony deviantony moved this from Confirmation required - Low priority to Need triage in Bug triage Mar 4, 2019
@immortalt
Copy link

I have the exact same issue as well.

@ellisonpatterson
Copy link

ellisonpatterson commented Oct 22, 2019

Same issue as well, how can you make this work since otherwise isn't the option useless?
Also an error occurs if you immediately switch the network back to host/bridge or whatever, and it complains that whatever was selected in the dropdown no longer exists, and you need to re-enter the container edit page to be able to deploy it again.

@CatFoxVoyager
Copy link

CatFoxVoyager commented Oct 22, 2019 via email

@immortalt
Copy link

Finally I have to use the docker-compose to solve my problem.

@smcpeck
Copy link

smcpeck commented Nov 17, 2019

@immortalt How did you do a container-mapped network with docker compose?

@ghost ghost self-assigned this Nov 26, 2019
@deviantony deviantony added the priority/normal Core team priority label Nov 26, 2019
@ghost ghost moved this from Need triage to Confirmed in Bug triage Nov 28, 2019
@ghost ghost added priority/low Core team priority and removed priority/normal Core team priority labels Jan 13, 2020
@C2BB
Copy link

C2BB commented Apr 1, 2020

Curious if there is an expected time frame for this fix?

@cyrus104
Copy link

This would be helpful, I am running several services on different ports but I want groups on the same IP. I have a macvlan setup and have setup a container with 1 ip and would like other containers to use the container options to use that same IP address with different ports.

@ghost
Copy link

ghost commented Apr 20, 2020

Reproduced on 1.23.2

@deviantony deviantony unassigned ghost Apr 20, 2020
@deviantony deviantony removed the priority/low Core team priority label Apr 20, 2020
@ghost ghost added the severity/low label Apr 24, 2020
@viktorkho
Copy link

viktorkho commented May 4, 2020

@immortalt Can you please tell us How did you do a container-mapped network with docker compose?

I have the same problem on clean compose.

BTW, seems this issue is not for Portainer itself, but for Docker/Compose stack.

@smcpeck
Copy link

smcpeck commented May 4, 2020

@viktorkho
FWIW here, I've resorted to creating the needed container via the command line with the parameter:

--net=container:other_container

This creates the container as desired and then I can restart the container (if needed) in portainer. Still not ideal as I have to treat that container with care; I haven't attempted to recreate the container in portainer. But this approach has been getting me by from a functional POV here.

@ghost
Copy link

ghost commented Jun 26, 2020

Reproduced on the development branch. Closing as this will be addressed via #3964 in v2.0

Note you now get the error: conflicting options: dns and the container type network mode as we now allow setting dns

@ghost ghost closed this as completed Jun 26, 2020
Bug triage automation moved this from Confirmed to Fixed Jun 26, 2020
@ghost ghost assigned deviantony Jul 9, 2020
@deviantony deviantony removed their assignment Jul 9, 2020
@duhruh
Copy link

duhruh commented Jul 31, 2020

@itsconquest is this fixed on a branch or something, still am getting the error and I would really like to not have to deploy the container via the command line as suggested above 😢

@ghost
Copy link

ghost commented Aug 3, 2020

@duhruh a fix is currently merged in the develop branch pending release in v2.0 of Portainer

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests