Ad
How To Use Host Network While Linking To A Container?
In my docker-compose:
laravel:
image: trackware
links:
- postgis:postgis
ports:
- "80:80"
- "3306:3306"
- "443:443"
- "220:22"
- "8000:8000"
net: "host"
restart: always
volumes:
- C:/H/repositories/pubnub:/share
container_name: laravel
postgis:
image: mdillon/postgis
env_file: .postgis_env
ports:
- "9090:9000"
- "54320:5432"
container_name: postgis
if I run docker-compose up -d
I get this error:
Conflicting options: host type networking can't be used with links. This would result in undefined behavior
So, how would I use net: "host"
while linking to postgis container?
laravel container needs to run pubnub client, which will need high-performance networking for real time messages handling, and also it needs to link to postgis
container to access db.
So, any advice? I am using docker 1.10.2
Ad
Answer
Since you expose postgis ports to host, you can skip linking and connect to it through localhost:9000
. I believe this will work since the Laravel application resides on the host network and they will share those ports.
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad