简体   繁体   中英

Accessing host's host:port from Docker container in OSX

This question may be similar to other questions already answered, but I could not find any that is specific to OSX.

I'm new to Docker. I'm using Docker Version 1.12.1-beta25 (build: 11807) native support for OSX. I wanted to install a Docker Bamboo remote agent, following the instructions at https://confluence.atlassian.com/bamboo/getting-started-with-docker-and-bamboo-687213473.html . My Bamboo server is running on the host.

When running the Docker container with docker run -e HOME=/root/ -e BAMBOO_SERVER=http://hostname:port/bamboo -i -t atlassian/bamboo-java-agent:latest , it failed with Connecting to http://hostname:port/bamboo refused

The problem seems to be that the container could not access the host's http://hostname:port/bamboo . What do I need to do to get this working?

You may try to use http://172.17.0.1:port to find the host from the container. You find this address with docker inspect 'name'.

Or, you can use -p hostPort:containerPort in the docker run command and yse http://localhost:containerPort as Banboo_server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM