{"action":"opened","issue":{"url":"https://api.github.com/repos/phusion/passenger-docker/issues/122","labels_url":"https://api.github.com/repos/phusion/passenger-docker/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/phusion/passenger-docker/issues/122/comments","events_url":"https://api.github.com/repos/phusion/passenger-docker/issues/122/events","html_url":"https://github.com/phusion/passenger-docker/issues/122","id":117613997,"number":122,"title":"Trying to add MySQL connector to the container","user":{"login":"mariowise","id":1569327,"avatar_url":"https://avatars.githubusercontent.com/u/1569327?v=3","gravatar_id":"","url":"https://api.github.com/users/mariowise","html_url":"https://github.com/mariowise","followers_url":"https://api.github.com/users/mariowise/followers","following_url":"https://api.github.com/users/mariowise/following{/other_user}","gists_url":"https://api.github.com/users/mariowise/gists{/gist_id}","starred_url":"https://api.github.com/users/mariowise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariowise/subscriptions","organizations_url":"https://api.github.com/users/mariowise/orgs","repos_url":"https://api.github.com/users/mariowise/repos","events_url":"https://api.github.com/users/mariowise/events{/privacy}","received_events_url":"https://api.github.com/users/mariowise/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-18T15:42:38Z","updated_at":"2015-11-18T15:42:38Z","closed_at":null,"body":"Hi, I've a problem trying to connect a Rails app on the `passenger-full` container and a `mysql` container. Both are linked in a compose file\r\n\r\n\tapp:\r\n\t  build: ./rails\r\n\t  ports:\r\n\t    - \"80:80\"\r\n\t  links:\r\n\t    - database\r\n\t  volumes:\r\n\t    - ./rails:/home/app/webapp\r\n\tdatabase:\r\n\t  image: mysql\r\n\t  environment:\r\n\t    - MYSQL_DATABASE=\"dockertest\"\r\n\t    - MYSQL_USER=\"dockertest\"\r\n\t    - MYSQL_PASSWORD=\"dockertest\"\r\n\t    - MYSQL_ROOT_PASSWORD=\"root\"\r\n\r\nSo I added the `apt-get install` at the top of my Dockerfile like this\r\n\r\n\tFROM phusion/passenger-full\r\n\tRUN apt-get update && apt-get install libmysqlclient-dev mysql-client -y\r\n\r\n\t# Set correct environment variables.\r\n\tENV HOME /root\r\n\r\n\t# Use baseimage-docker's init process.\r\n\tCMD [\"/sbin/my_init\"]\r\n\r\n\tRUN rm -f /etc/service/nginx/down\r\n\tRUN rm /etc/nginx/sites-enabled/default\r\n\tADD webapp.conf /etc/nginx/sites-enabled/webapp.conf\r\n\r\n\tRUN mkdir /home/app/webapp\r\n\tWORKDIR /home/app/webapp\r\n\tADD . /home/app/webapp\r\n\tRUN cd /home/app/webapp && bundle install\r\n\tRUN touch /home/app/webapp/tmp/restart.txt\r\n\r\n\t# Clean up APT when done.\r\n\tRUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\r\n\r\nThe problem is that I cant stop recieving the error \r\n\r\n    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)\r\n\r\nAlso this is my `database.yml` in the Rails app.\r\n\r\n\tdefault: &default\r\n\t  adapter: mysql2\r\n\t  database: dockertest\r\n\t  host: <%= ENV['MYSQL_PORT_3306_TCP_ADDR'] %>\r\n\t  port: <%= ENV['MYSQL_PORT_3306_TCP_PORT'] %>\r\n\t  username: dockertest\r\n\t  password: dockertest\r\n\r\n\tdevelopment:\r\n\t  <<: *default\r\n\r\n\tproduction: \r\n\t  <<: *default\r\n\r\n\r\nIs that the right way to do this? As you can see i'm pretty new to docker.\r\n"}}