-1

Hi i'm start a docker container using docker-compose, but when i try to use localhost to connect I can't connect. Here is the docker-compose i'm using:

version: '3.3'

services:

  standalone:
    image: apachepulsar/pulsar
    expose:
      - 8080
      - 6650
    environment:
      - PULSAR_MEM=" -Xms512m -Xmx512m -XX:MaxDirectMemorySize=1g"
    command: >
      /bin/bash -c
      "bin/apply-config-from-env.py conf/standalone.conf
      && bin/pulsar standalone"

Im using windows 10

elcharrua
  • 1,582
  • 6
  • 30
  • 50
  • 1
    Try with `ports: 8080:8080` instead of `expose`.Take a look at [this anwser](https://stackoverflow.com/a/40801773/7736617) to see the difference between `ports` and `export` – Arnaud Claudel Aug 18 '19 at 18:29
  • What docker environment are you using? `docker-windows`? Could you try accessing it using the ip that `docker-machine ip` outputs. – MaartenDev Aug 18 '19 at 18:30
  • when I try docker-machine ip it outputs: Error: No machine name(s) specified and no "default" machine exists – elcharrua Aug 18 '19 at 18:55

1 Answers1

2

Be aware that expose, as the documentation suggest:

Expose ports without publishing them to the host machine - they’ll only be accessible to linked services. Only the internal port can be specified.

My guess is that you instead want to publish them and let them be available to the host. To do so:

services:

  standalone:
    image: apachepulsar/pulsar
    ports:
      - "8080:8080"
      - "6650:6650"
Federkun
  • 36,084
  • 8
  • 78
  • 90