help with docker compose

fultonbrowne profile image Fulton Browne ・1 min read

hey I am working on a project using docker compose. I need one image to use the other images' 5001 port and its not working... if I run this outside a docker container using standard version of these services it seems to work fine.
here is my docker compose file:

version: "3"
    image: fulton/pegasus
      - 8000:8000
      - ipfs
    image: ipfs/go-ipfs
      - 5001:5001
      - 8080:8080

and here is the code that is giving the errors (its kotlin)

val response =

I am pretty new to compose and any help will be awesome :]


markdown guide

You need the links directive on the container that will access the other one.

For example


Also, you might wanna try instead of


Links have been deprecated for quite some time and networks are the recommended approach:



Good to know. I've never used it until I had to use docker on Windows, for some reason, it's the only way that the network would work.

yeah, I'm aware a lot of people experience problems with docker on windows, I've never really got into any problems other than slowness compared to linux. it's actually quite stable for me.

Linux definitely is the best option


Like Carlos mentioned, you should just be able to reference it like this:


Docker compose automatically creates a network for you, in which you can reference other containers by using their name. These names are saved in /etc/hosts inside of the containers, so they automatically resolve to the correct IP address.


you should create a network for the compose, name each service, and access the services by name and you don't even need to expose the ports on the host.

even without changes, in your case, if you change the url to ipfs:5001 it will work.

ps: you should really read-up on docker networking in general, because it's just by chance that it works in your scenario anyway


thank you sir, it works :)


can we see domain name in a internal docker network ??