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

Cannot publish a container's port(s) to the host with --net option. #16765

Open
bear0330 opened this issue Oct 5, 2015 · 7 comments
Open

Cannot publish a container's port(s) to the host with --net option. #16765

bear0330 opened this issue Oct 5, 2015 · 7 comments

Comments

@bear0330
Copy link

bear0330 commented Oct 5, 2015

When I run
docker run -p 8000:8000 --net=container:81cc21830839 centos /bin/bash
it won't publish 8000 to host, nor --net=host.

docker version

Client version: 1.7.1
Client API version: 1.19
Package Version (client): docker-1.7.1-108.el7.centos.x86_64
Go version (client): go1.4.2
Git commit (client): 3043001/1.7.1
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Package Version (server): docker-1.7.1-108.el7.centos.x86_64
Go version (server): go1.4.2
Git commit (server): 3043001/1.7.1
OS/Arch (server): linux/amd64

docker info

Containers: 17
Images: 426
Storage Driver: devicemapper
 Pool Name: docker-8:1-525892-pool
 Pool Blocksize: 65.54 kB
 Backing Filesystem: extfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 12.7 GB
 Data Space Total: 107.4 GB
 Data Space Available: 9.442 GB
 Metadata Space Used: 19.94 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.128 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.93-RHEL7 (2015-01-28)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-229.7.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
CPUs: 2
Total Memory: 3.362 GiB
Name: gicc-bearh-1
ID: 5PEC:WZUG:XD3N:W36D:NAM5:362V:J5KD:PGE4:OVLS:DUE7:4SNN:WPJQ
@GordonTheTurtle
Copy link

Hi!

Please read this important information about creating issues.

If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

This is an automated, informational response.

Thank you.

For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:
docker info:
uname -a:

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Provide additional info you think is important:

----------END REPORT ---------

#ENEEDMOREINFO

@thockin
Copy link
Contributor

thockin commented Oct 5, 2015

When using --net=container you have to publish ports from the container
that actually owns the namespace. We filed this, too and we told "working
as intended".

On Mon, Oct 5, 2015 at 8:05 AM, Bear Huang notifications@github.com wrote:

When I run
docker run -p 8000:8000 --net=container:81cc21830839 centos /bin/bash
it won't publish 8000 to host, nor --net=host.

docker version

Client version: 1.7.1
Client API version: 1.19
Package Version (client): docker-1.7.1-108.el7.centos.x86_64
Go version (client): go1.4.2
Git commit (client): 3043001/1.7.1
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Package Version (server): docker-1.7.1-108.el7.centos.x86_64
Go version (server): go1.4.2
Git commit (server): 3043001/1.7.1
OS/Arch (server): linux/amd64

docker info

Containers: 17
Images: 426
Storage Driver: devicemapper
Pool Name: docker-8:1-525892-pool
Pool Blocksize: 65.54 kB
Backing Filesystem: extfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 12.7 GB
Data Space Total: 107.4 GB
Data Space Available: 9.442 GB
Metadata Space Used: 19.94 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.128 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.93-RHEL7 (2015-01-28)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-229.7.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
CPUs: 2
Total Memory: 3.362 GiB
Name: gicc-bearh-1
ID: 5PEC:WZUG:XD3N:W36D:NAM5:362V:J5KD:PGE4:OVLS:DUE7:4SNN:WPJQ


Reply to this email directly or view it on GitHub
#16765.

@bear0330
Copy link
Author

bear0330 commented Oct 5, 2015

Sorry, I missed uname -a:
Linux gicc-bearh-1 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11 UTC 2015 x86_64 x86_64 x86_64 GNU/Linu

So, I cannot publish any additional ports when using --net option? Would this be possible a new feature?
Thanks.

@thockin
Copy link
Contributor

thockin commented Oct 5, 2015

My issues was closed "working as intended", though I disagreed.

On Mon, Oct 5, 2015 at 8:22 AM, Bear Huang notifications@github.com wrote:

Sorry, I missed uname -a:
Linux gicc-bearh-1 3.10.0-229.7.2.el7.x86_64 #1 SMP Tue Jun 23 22:06:11
UTC 2015 x86_64 x86_64 x86_64 GNU/Linu

So, I cannot publish any additional ports when using --net option? Would
this be possible a new feature?
Thanks.


Reply to this email directly or view it on GitHub
#16765 (comment).

@thaJeztah
Copy link
Member

/cc @mavenugo @mrjana PTAL

@LK4D4
Copy link
Contributor

LK4D4 commented Sep 16, 2016

ping @mavenugo @mrjana @aboch @sanimej

@scorpp
Copy link

scorpp commented Oct 26, 2016

I'm also on same issue and quite disappointed. I'll outline my case and maybe it would make any sense:

I need to set up a build server which fetches sources over VPN connection. For some reasons I cannot (or don't want) to install VPN client on host. So my intention was to have a vpn-client as a docker container, then run build-server container with --net=vpn-client to make build server access sources code and to publish ports on build-server to access it's web-ui.

Is there an 'intended' way to achieving this in docker?

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

7 participants