# Problem with Rancher Catalog / Docker-compose

**URL:** <https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633>\
**Category:** Rancher 1.x\
**Created:** [August 4, 2016, 3:26pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633 "2016-08-04T15:26:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehd-io](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mehd-io](https://forums.suse.com/u/mehd-io)\
**Post date:** [August 4, 2016, 3:26pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/1 "2016-08-04T15:26:06Z")

</div>

Hi,

I’m pretty new to rancher, sorry if I’m missing something important.

I tried to directly launch a stack for the catalog, e.g wordpress. Everything was running but couldn’t access wordpress on the browser. (Yes, net.ipv4.conf.all.forwarding is up)

So I did a basic docker file :

```
db:
    image: mysql:5.7
    volumes:
      - "/home/test/db:/var/lib/mysql"
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: wordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
wordpress:
    image: wordpress:latest
    links:
      - db
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_PASSWORD: wordpress

```

And try to run it with rancher stack (and adding this docker file). Everything running but still can’t access wordpress.

If I use docker-compose itself to generate this with the same file, it works and I can access wordpress website.

What am I missing ???

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [August 4, 2016, 3:55pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/2 "2016-08-04T15:55:15Z")

</div>

I had no issues running this in my own Rancher set up.

Do you have hosts set up in your Rancher environment that have port 8000 free?

Do teh containers come up?

---

<div class="post-metadata">

**Author:** ![mehd-io](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mehd-io](https://forums.suse.com/u/mehd-io)\
**Post date:** [August 4, 2016, 7:05pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/3 "2016-08-04T19:05:38Z")

</div>

Yeah port are free and in both case the containers are up and running.  
Basically the thing is that if i’m running this through rancher and the stack option (Add stack, import docker-compose), it runs but can’t access it. And I checked on the stack, the containers are correctly linked…  
If I directly use docker-compose to run this, it works and I can access wordpress site on 8000.

---

<div class="post-metadata">

**Author:** ![mehd-io](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mehd-io](https://forums.suse.com/u/mehd-io)\
**Post date:** [August 4, 2016, 7:29pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/4 "2016-08-04T19:29:44Z")

</div>

Well I just saw that the status is “unhealthy” on wordpress actually and if i see the log i got :

```
8/4/2016 9:28:20 PMMySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known

```

Rancher is renaming the name of the container with r-stackname\_containerName does this may be the problem ?

---

<div class="post-metadata">

**Author:** ![mehd-io](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mehd-io](https://forums.suse.com/u/mehd-io)\
**Post date:** [August 7, 2016, 10:43am UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/5 "2016-08-07T10:43:57Z")

</div>

Any clue on this ? I’m a bit disappointed that things out of the box doesn’t work btw, i’m using cattle.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [August 7, 2016, 6:11pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/6 "2016-08-07T18:11:08Z")

</div>

> [@mehd-io](#):
>
> WORDPRESS\_DB\_HOST: db:3306

I’m on my phone but doesn’t WordPress expect a separate variable for the port? I think you’re trying to resolve “db:3306” in DNS, which obviously fails… And vanilla docker-compose probably sets the link environment variables last, which overrides that one with just an IP, so it happens to work.

---

<div class="post-metadata">

**Author:** ![mehd-io](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@mehd-io](https://forums.suse.com/u/mehd-io)\
**Post date:** [August 7, 2016, 6:50pm UTC](https://forums.suse.com/t/problem-with-rancher-catalog-docker-compose/3633/7 "2016-08-07T18:50:24Z")

</div>

> [@mehd-io](#):
>
> hp\_network\_getaddresses: getaddrinfo failed: Name or service not known

I don’t think so, not for the DB. I basically get the same error if I just create a wordpress stack from rancher catalog… It’s for sure a DNS issue but normally Cattle should directly write the proper dns records right ?
