Open rysiekpl opened 9 years ago
The idea of Docker is to isolate applications, so they can only use networking to communicate...
The idea of Docker is to isolate applications, full stop. Using UNIX sockets for applications in a single group (say, managed by docker-compose
) makes it possible to not have certain containers/applications listening on any network ports, which adds some additional security.
Moreover, it makes it possible not to worry about "which IP address this container will get this time". If we're talking UNIX sockets through data volume containers, we don't have to worry about network stuff where network stuff is not needed.
UNIX sockets can also be actually faster than TCP/IP stack in certain scenarios. Also, all underlying libraries (esp. the PostgreSQL library) support UNIX sockets.
i agree that we need to add support for unix sockets. but due to time limitations this is not very high on my priority list. This will only have lasting performance improvements on large installations me thinks.
I have implemented a UNIX socket connection via a DVC from gitlab to ngnix. Making connections to databases is not a big deal. After @sameersbn will finish porting 8.0.0 I will create a PR.
p.s. the sameersbn/postgresql and sameersbn/mysql images already expose volumes that contain the unix domain sockets. Simply doing a --volumes-from
would make this volume available to the gitlab container. Just a couple of changes are required in the entrypoint.sh
script to detect and configure database.yml
accordingly.
After @sameersbn will finish porting 8.0.0 I will create a PR.
This is for the best.
Any news on this?
@ivlis I will be happy to review your PR with this feature.
@rysiekpl @sameersbn Thanks for reminding me about that :smile:. Gitlab is changing rapidly, I'll update my config to the current version and submit a PR soon. I'm still on 7.14 for my personal server.
This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.
Reading the documentation I cannot find how to configure GitLab docker container to connect to a database (in my case: PostgreSQL) via a UNIX socket. If UNIX sockets are not supported, it would be worthwhile to add such a support, methinks!