These are chat archives for allegro/ralph

22nd
May 2015
docrookie
@docrookie
May 22 2015 11:02
Hello All , I am rookie with dockers so far - can you please help me out to find out how I can connect from dockers container to mysql database which is not setup locally but came from ralph ?
docrookie
@docrookie
May 22 2015 11:11
I am trying to run this one :smile: docker run -P -t -i -volumes-from mysql_data allegrogroup/ralph:latest /home/ralph/init.sh
the thing is to access mysql and create remote user
docrookie
@docrookie
May 22 2015 11:26
getting follwoing error : Unable to find image 'mysqldb:latest' locally
should I create image first ?
getting error :smile: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 11:35
dockrookie - you want to access db from outside of docker?
what is your setup currently? do you have separate mysql server ?
docrookie
@docrookie
May 22 2015 11:40
no I dont have separate mysql server only that one which came from ralph
I would like to access db from container , is it possible ?
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 11:40
yes it is possible of course
docrookie
@docrookie
May 22 2015 11:41
as I need to create remote user in db to allow web access to ralph
can you please provide any doc file or just suggestion what should be done ?
thank you
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 11:42
but describe what is remote_user ? you mean remote db access or new ralph user ?
you can add as many users as you want via ralph admin gui
docrookie
@docrookie
May 22 2015 11:43
yes I mean remote db access
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 11:43
so there are 2 options
1) expose internal mysql port for outside - easy
2) just run docker exec … to jump into running container and do your mysql stuff mysql -u …
so the thing is:
try to run ralph with docker run -P -p 8000:8000 -p 3306:3306 -t -i --name ralph --mac-address=02:42:ac:11:ff:ff --volumes-from mysql_data allegrogroup/ralph:latest
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 12:07
if it doesn’t work we probably need to update docker image with EXPOSE command for 3306 port also
so just give a sign
docrookie
@docrookie
May 22 2015 12:11
ralph is running now - however I can not connect to db as db has been installed via init script including http server ,etc - the question is how to access that db which is not setup locally on the host ?
pleae give me an advise
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 12:12
@docrookie wait, i will try it out
docrookie
@docrookie
May 22 2015 12:13
ok
docrookie
@docrookie
May 22 2015 12:59
Just wondering Marcin if it is possible ... please let me know
docrookie
@docrookie
May 22 2015 13:29
thank you
Piotr Jarolewski
@szok
May 22 2015 13:37
@docrookie

OK,

Start of Docker Ralph as in the documentation.
(Latest docker image version, uploads now :))

docker pull allegrogroup/ralph:latest

Only add the port 3306

docker run -i -t -name mysql_data -v /var/lib/mysql -v /home/ralph/.ralph busybox /bin/sh -c "chown default /home/ralph; chown default /home/ralph/.ralph"

docker run -P -t -i --volumes-from mysql_data allegrogroup/ralph:latest /bin/bash /home/ralph/init.sh

docker run -P -p 8000:8000 -p 3306:3306 -t -i --name ralph --mac-address=02:42:ac:11:ff:ff --volumes-from mysql_data allegrogroup/ralph:latest

Mac OS X:
mysql -h boot2dockerIP -u ralph -p
Password: ralph

Linux:
127.0.0.1 or localhost

mysql -h 127.0.0.1 -u ralph -p
Password: ralph

Example:

piotr.jarolewski@polpc00886 ~/a/ralph-docker (master)> mysql -h 192.168.59.103 -u ralph -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.5.43-0ubuntu0.12.04.1 (Ubuntu)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Bye

docrookie
@docrookie
May 22 2015 13:44
Thank you - still having issue :Warning: '-name' is deprecated, it will be replaced by '--name' soon. See usage.
FATA[0000] Error response from daemon: Conflict. The name "mysql_data" is already in use by container 22ebdf1281cc. You have to delete (or rename) that container to be able to reuse that name.
should I delete /reneme existing container ?
Piotr Jarolewski
@szok
May 22 2015 13:46
You have to remove the old containers, just that you lose the data. But this is a test version?
docker ps -l
docker rm container_id
docrookie
@docrookie
May 22 2015 13:47
yes
Piotr Jarolewski
@szok
May 22 2015 13:47
ok, delete them
✪ vi4m Marcin Kliks
@vi4m
May 22 2015 14:06
Why?
Why deleting mysql data ?
@szok cant we just update Docker image ?
Piotr Jarolewski
@szok
May 22 2015 14:07
@vi4m yes
@docrookie work?
Piotr Jarolewski
@szok
May 22 2015 14:16
Yes, we updated only image.
The fact that there was no need to remove mysql storage.