Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
620hun81887y@tracktraps Hey, I hit a wall with something else, maybe you can help. How do I make my containers talk to each other in swarm mode. They are on the same network, I made sure, I just don't know how to achieve the "links" equivalent of swarm. I have a nginx container that's exposed on 80, and that should fowrard requests to 8001 of my web container. But that doesn't happen.
-
@620hun Just a example of how I do it (apache + adminer + mysql):
!#/bash
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
docker run --name mysqlserver -t -i -p 3306:3306 -d -e MYSQL_ROOT_PASSWORD=rootpass -v ~/.config/MySQL/my.cnf:/etc/my.cnf -v /mnt/databases/mysql:/var/lib/mysql mysql/mysql-server
docker run --name adminer -d --link mysqlserver:mysql -e PMA_HOST=172.17.0.2 -p 8095:80 clue/adminer
docker run --name apache --link mysqlserver:mysql -t -i -d -p 8080:80 -e XDEBUG_ENABLE=1 -e xdebug.remote_enable=1 -e xdebug.remote_connect_back=1 /mnt/projects/xxx/:/var/www webserver:apache -
620hun81887y@tracktraps Turns out that it was a nginx:alpine issue. It works fine with the regular image 🙄 but cheers!
I wish Docker had docs explaining how to migrate EXISTING projects. The pros better outweigh the cons after all this time...
undefined