RedpointArchive / phabricator

A Docker image that runs Phabricator, an open source software engineering tool
https://hub.docker.com/r/redpointgames/phabricator/
307 stars 98 forks source link

Fix problem when linking a database through a container #40

Closed Polpetta closed 8 years ago

Polpetta commented 8 years ago

Hello, I found that this issue was already submitted ( #29 ), so I fixed it. I try it on my PC and seems to work. I used this commands:

#build the image with my fix
docker build -t polpetta/phabricator .
#launch a mysql container
docker run --name phabricatorDB -e MYSQL_ROOT_PASSWORD=123456 -d mysql
#launch the image
docker run --rm -p 80:80 -p 443:443 -p 22:22  \
   --link phabricatorDB:mysql \
   --env PHABRICATOR_HOST=<your adress> \
   --env MYSQL_LINKED_CONTAINER=mysql \
   --env MYSQL_USER=root \
   --env MYSQL_PASS=123456 \
   --env PHABRICATOR_REPOSITORY_PATH=/repos 
   polpetta/phabricator

Now MYSQL_HOST have the MYSQL_LINKED_CONTAINER value when linking a container, and now it works.

hach-que commented 8 years ago

This isn't the correct fix; the address for a container port is provided by <CONTAINERNAME>_PORT_3306_TCP_ADDR.

The correct fix is that ${MYSQL_LINKED_CONTAINER} probably needs to go through capitalization because Docker will convert a linked container named mariadb to MARIADB_PORT_3306_TCP_ADDR, and the current code will check mariadb_PORT_3306_TCP_ADDR.

Polpetta commented 8 years ago

Sorry for replying so late. Ok, when I have time I will try in a different way! :blush: For now I close this pull request.