Reputation: 9038
What is the best way to separate different projects development environments with docker ?
Talking about Mac, when it was not native supported, I used to have two docker-machine, lets say projectA and projectB, so I just eval $(docker-machine env projectA)
in order to access all the containers for this project.
In terms of containers I had:
ProjectA:
ProjectB:
Is it possible to have such separation so anyone that does docker ps -a
will only see the containers related to the currently selected machine?
I can keep doing this with docker-machine but then it will not use native-enabled features and perform slower.
Thanks!
Upvotes: 0
Views: 76
Reputation: 19194
Docker isn't natively supported on the Mac - Docker for Mac uses native virtualization, but there's still a Linux VM running which the Docker client connects to.
You're right that the performance and integration is better with Docker for Mac but the trade-off is that you only get one VM, you can't create a second VM and have two Docker engines running, which is the only way to physically segregate containers.
Docker for Mac and Docker Toolbox can coexist, so that's one option. The other option is to segregate them logically - by running related containers in the same Docker network - but they'd still all show in docker ps
.
Upvotes: 1