3

I've just been introduced to Docker and the concept is awesome. I've found simple Dockerfiles for building an image for MongoDB and Node and was wondering, do I just combine those images together to make one image that has my project which is a combination of a custom Node app (built on Express), a NodeBB forum, backed by MongoDB, all wired together with Passport providing single-sign-on. Or should I make them all separate Images.

Can a Docker image contain its own VPN with the various services running on different VMs?

qkrijger
  • 26,686
  • 6
  • 36
  • 37
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
  • 1
    You could have searched. But here: http://docs.docker.io/en/latest/use/networking/ Read that and especially the link at the bottom – Neil Lunn Mar 03 '14 at 09:52
  • 1
    @dave-sag If you get your docker files working, feel free to share them with the community! :D – Julian H. Lam Mar 07 '14 at 16:22
  • 3
    @Neil Lunn "You could have searched." That is a ridiculous response. Maybe he did search. Maybe he did not come across that page. I searched and came across this page which contained your link. It was helpful. Keep the 'you should google it' responses to yourself. The whole point of this website is to help people answer questions. The answer to this question is not a glaringly obvious one that anyone should just be expected to glean from the internet with no help necessarily. – Anthony Ruffino Oct 15 '14 at 13:54

1 Answers1

2

Docker does not have a standardized way to package and provision applications consisting of multiple images, so if you want to share your application, it's probably best to put everything into a single Dockerfile. Having said that, if sharing your application isn't a huge priority using multiple Docker images may be easier to maintain (plus you'll be able to use other MongoDB images). You could then use something like Fig (http://orchardup.github.io/fig/) to orchestrate the entire application.

As for communication between Docker containers, Docker has two options: enabling all communication across containers (this is the default), or disabling all communication except for those specified. You can enable the second option by passing the flag "--icc=false" to the Docker daemon. Afterwards, you'll need to explicitly "expose" and "link" containers in order for them to communicate. The relevant documentation can be found here.

jhorey
  • 166
  • 2
  • 5