# Using a container in multiple stacks

**URL:** https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796
**Category:** Rancher 1.x
**Created:** [August 24, 2016, 12:43am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796 "2016-08-24T00:43:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ccatlett2000](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ccatlett2000/32/1622_2.png) [@ccatlett2000](https://forums.suse.com/u/ccatlett2000)
#### Post date: [August 24, 2016, 12:43am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796/1 "2016-08-24T00:43:37Z")

</div>

I have a question on using a container in multiple stacks/services with Rancher. For example, say I have a MySQL server I want to host with Rancher. Is it possible to use that MySQL server in my mail stack as well as my Wordpress stack? I’d like to avoid having to spawn a new MySQL container for each and every service, but still be able to leverage Rancher’s service/stack system to neatly bundle up my containers.

So really, my question is whether or not this is possible, and if it is, how?

---

<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 24, 2016, 1:06am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796/2 "2016-08-24T01:06:34Z")

</div>

Yes, you can link to/use services in other stacks.

---

<div class="post-metadata">

### Author: ![ccatlett2000](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ccatlett2000/32/1622_2.png) [@ccatlett2000](https://forums.suse.com/u/ccatlett2000)
#### Post date: [August 24, 2016, 1:21am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796/3 "2016-08-24T01:21:35Z")

</div>

How should I got about doing this? Do I just deploy a standalone container with the db and then add a link for the stack?

---

<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 24, 2016, 5:46am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796/4 "2016-08-24T05:46:05Z")

</div>

You’d deploy a service with scale of 1 and then you can use the links for other services in other stacks.

---

<div class="post-metadata">

### Author: ![kiboro](https://avatars.discourse-cdn.com/v4/letter/k/7993a0/32.png) [@kiboro](https://forums.suse.com/u/kiboro)
#### Post date: [August 24, 2016, 9:37am UTC](https://forums.suse.com/t/using-a-container-in-multiple-stacks/3796/5 "2016-08-24T09:37:05Z")

</div>

The key part you need is external\_links. This is from one of our services which uses a eureka service which is part of the infrastructure stack. That sounds like very much what you’re proposing

external\_links:

- ‘infrastructure/eureka:’
