Want to import mongoDB BI connector port, in Docker container Cubejs

I create cubejs image and it run perfectly now i want to use external ports into container. Docker Yaml

version: '2.2'
services: 
  cube: 
    env_file: .env
    image: cubejs/cube:v0.29.28
    ports: 
      - 4000:4000
      - 3000:3000
    volumes: 
      - .:/cube/conf
      - .empty:/cube/conf/node_modules/@cubejs-backend/
    extra_hosts:
      - 3307:3307

it generate an error

Recreating 955c9fb59ee8_hello-world_cube_1 … error
ERROR: for 955c9fb59ee8_hello-world_cube_1 Cannot create container for service cube: invalid IP address in add-host: “3307”
ERROR: for cube Cannot create container for service cube: invalid IP address in add-host: “3307” ERROR: Encountered errors while bringing up the project.

please guide me what i am doing wrong.
i just to use mongo BI connector in docker, port is 3307

the solution is simly ahh the line into your yaml

services:
my-service:
network_mode: host

if you use the docker image then run this command with it,

docker run -d --network=host my-container:latest

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.