在我的被告席上-作曲:

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

推荐答案

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.

Laravel相关问答推荐

哈希:check()不返回预期结果Laravel 10

如何使中继器项目计数动态Laravel Filament V3?

Livewire 3分页在点击后不更新页面

如何在 Laravel 9 中获取带分页的订单列表?

Laravel 5 如何配置 Queue 数据库驱动程序以连接到非默认数据库?

Laravel created_at 返回对象代替数据库中的日期格式?

如何防止 Laravel 路由被直接访问(即非 ajax 请求)

Laravel Eloquent - 随叫随到的加密/解密数据

如何访问 Validator::extend 中的其他输入属性?

Laravel 5.7 判断Electron邮件是否经过验证

判断 Laravel 模型表中是否存在列,然后应用条件

laravel 5中的配置缓存导致找不到视图

如何卸载 Laravel?

Laravel 判断约束违规

Laravel Eloquent 在子查询中有两个WHERE NOT IN

测试指向外部站点的重定向链接

Laravel League/flysystem 使用 AWS S3 获取文件 URL

Guzzle 返回流空体而不是 json 体

将值插入隐藏输入 Laravel Blade

如何在不要求用户登录 Laravel 的情况下验证Electron邮件