Search code examples
wso2dockerboot2docker

WSO2 Governance Registry, Docker and boot2docker


I'm using boot2docker on OSX 10.10 to try to run the WSO2 governance registry. I cannot reach the app from the host machine (OSX).

Here's my Dockerfile:

FROM dockerfile/java:openjdk-7-jdk
MAINTAINER Andrew Matthews

COPY wso2greg-4.6.0.zip /opt/

RUN unzip /opt/wso2greg-4.6.0.zip -d /opt && \
    rm /opt/wso2greg-4.6.0.zip

EXPOSE 9443
CMD ["/opt/wso2greg-4.6.0/bin/wso2server.sh"]

This follows a pattern used by others on docker.io for other wso2 apps.

I built it with:

docker build -t="usmsnp/wso2greg" .

and ran it with

docker run -i -t -P usmsnp/wso2greg

everything seems to proceed nicely - I get as far as the wso2 announcement:

Mgt Console URL  : https://172.17.0.27:9443/carbon/

I have the boot2docker vm IP address aliased as dockerhost in my /etc/hosts file, and when I navigate to https://dockerhost:9443/carbon/ using curl I get connection refused.

Any ideas?

UPDATE: 2014-11-28

When I deploy the image to AWS using tutum, it works. So, mission accomplished, I suppose. But I'm still confused about why it doesn't work. I understand that boot2docker requires a different IP address, but I used that.


Solution

  • When you use docker run -P you're telling Docker to allocate a random port on the Docker daemon host - not to use 9443.

    So in this case, you'll need to run docker ports <containerid> to find out what port its been mapped to.

    alternativly, you need to use docker run -p 9443:9443 ... to tell Docker to map the external 9443 to the container's 9443