# Add identity to new conatiner in docker-compose quickstart

**URL:** <https://openziti.discourse.group/t/add-identity-to-new-conatiner-in-docker-compose-quickstart/2840>\
**Category:** Uncategorized\
**Created:** [July 11, 2024, 12:38am UTC](https://openziti.discourse.group/t/add-identity-to-new-conatiner-in-docker-compose-quickstart/2840 "2024-07-11T00:38:54Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![TheLumberjack](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/thelumberjack/32/113_2.png) [@TheLumberjack](https://openziti.discourse.group/u/TheLumberjack)\
**Post date:** [July 16, 2024, 1:51pm UTC](https://openziti.discourse.group/t/add-identity-to-new-conatiner-in-docker-compose-quickstart/2840/12 "2024-07-16T13:51:22Z")

</div>

> [@colin](#):
>
> How is the docker tunneler used then as I seem to be completely off point on that ? - can you give me an example of how it could work to explain it ?

You're not completely off point, but in this situation, since there's ALREADY a tunneling-type device on the blue network (that router), adding **another** tunneler (ziti-host) won't do much good (well i mean, there's redundancy-related reasons but i'm leaving that off the table right now).

This is where things get more complex, really quickly... Recently, (a few months ish ago) @qrkourier made an **excellent** discovery with respect to docker. He discovered that one can basically assign a docker container as the "network" for **another** docker container. When you do this, it effectively melds the two containers into one bigger container. If you're familiar with kubernetes even a little, this is very similar to the "pod" idea where basically two or more containers can all be aggregated together.

This was **really** exciting to me, because in general when you're using docker, we had no great way to accomplish this sort of design. If you use `ziti-edge-tunnel` and want to have it intercept packets it works by making a TUN device but that needs to happen on the actual OS itself. That means everything on the machine will have access to that TUN and that's not what we wanted...

Instead, `ziti-router` has a mode called `tproxy` that allows one to shuttle bytes to a process without the need for a TUN which means now we can use `ziti-router` within docker for strategic intercept-type modes but we could **also** use something like `ziti-edge-tunnel` in `host` mode (where it only offloads data) to offload data specifically for one (or more containers)...

I'll pause here, as I'm getting deep into the weeds now. Here's an attempt to demonstrate that visually though... Here's the example I'm recommending you start with.You'll see the "new-ubuntu-svr" is in the blue network and accessed from the ziti-private-blue router:  
 ![image](https://global.discourse-cdn.com/free1/uploads/netfoundry/original/2X/3/3e6925e069f7d009de1bacc193bbea30ec501166.png)

But, with the container as another container's network approach, it MIGHT look more like this... Notice the the ziti-private-blue was removed and replaced with a ziti-edge-tunnel in host mode (which is basically what ziti-host is) and each "network" has two containers, the ziti-host 'network' and then the 'server' container that uses that ziti-host network... Hopefully this all makes sense, like i said, it can get complex quickly ! 🙂

 ![image](https://global.discourse-cdn.com/free1/uploads/netfoundry/original/2X/e/e8ee51ac504b2098ca49b46e4d0c699e4e7d292e.png)

---

_[View the full topic](https://openziti.discourse.group/t/add-identity-to-new-conatiner-in-docker-compose-quickstart/2840)._
