opensupports / opensupports

OpenSupports is a simple and beautiful open source ticket system
http://www.opensupports.com/
GNU General Public License v3.0
919 stars 339 forks source link

host network not available on OS X #752

Closed jeff303 closed 4 years ago

jeff303 commented 4 years ago

As explained here, --net=host is not allowed on Mac OS X Docker. This seems to be what the opensupports-srv Docker container is relying upon (in the Makefile). I tried removing the --net parameter, and adding -P 8080:80 instead, and that seemed to make things work on OS X.

Can this be added to the installation instructions? I can try to open a PR if I can figure out a way to detect OS X with Make (not that familiar with Makefiles).

giacomobartoli commented 4 years ago

@jeff303 by editing the make file with the parameter -P 8080:80 instead of --net=host on your osx machine, then are you able to run the project? I am still struggling after days spent on it.

giacomobartoli commented 4 years ago

@jeff303 could you kindly provide me your Makefile?

jeff303 commented 4 years ago

Here is the patch file for what I changed. Also using a network instead of link, which is the modern approach. I got it to run using these changes.

diff --git a/server/Makefile b/server/Makefile
index 678716cd..c249536c 100644
--- a/server/Makefile
+++ b/server/Makefile
@@ -13,10 +13,11 @@ install:
        @docker exec -it opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}"

 run:
-       @docker run -d --name opensupports-db -p 4040:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v $(PWD)/.dbdata/:/var/lib/mysql mysql:5.6
-       @docker run -d --name opensupports-myadmin --link opensupports-db:db -p 6060:80 phpmyadmin/phpmyadmin
-       @docker run -d --name opensupports-fakesmtp -p 7070:25 -v ${PWD}/.fakemail/:/var/mail munkyboy/fakesmtp
-       @docker run -d --name opensupports-srv --net=host --rm -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v ${PWD}:/var/www/html opensupports-srv
+       @docker network create opensupports-network
+       @docker run -d --name opensupports-db --net=opensupports-network -p 4040:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -v $(PWD)/.dbdata/:/var/lib/mysql mysql:5.6
+       @docker run -d --name opensupports-myadmin --net=opensupports-network -p 6060:80 phpmyadmin/phpmyadmin
+       @docker run -d --name opensupports-fakesmtp -p 7070:25 --net=opensupports-network -v ${PWD}/.fakemail/:/var/mail munkyboy/fakesmtp
+       @docker run -d --name opensupports-srv -p 8080:80 --net=opensupports-network --rm -e LOG_STDOUT=true -e LOG_STDERR=true -e LOG_LEVEL=debug -v ${PWD}:/var/www/html opensupports-srv

 test:
        @./run-tests.sh
ivandiazwm commented 4 years ago

It should be fixed now, I created a shared network generated by make build