F
F
furyon2016-01-14 02:33:21
ubuntu
furyon, 2016-01-14 02:33:21

How to use one virtual machine for multiple applications?

Hello!
In the last question , I figured out how to organize a Linux working environment by developing on Windows. I will install VirtualBox + Samba.
Now I faced the following problem: I have about 10 virtual machines in production, let's say everyone has a different configuration, so installing 10 virtual machines is expensive and inconvenient.
What I want:
On one virtual machine, to have, as it were, completely isolated applications at all levels (file system, processes, software, etc.)
I started googling, stumbled upon Docker (although I had heard about it for a long time). But what do you recommend? Docker is what I need? Or maybe I want the impossible?
I will be glad for any help.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-01-14
@furyon

Docker is what I need? Or maybe I want the impossible?

Docker has a slightly different concept, but it fits even better.
The main idea is that each service is in its own container. That is, the database has its own container, the application has its own, and nginx has its own separate container. On average, one simple application requires 3 containers (application, database and web server as a proxy). If you have 10 projects, then it will be 30 containers. Well, yes, do not forget about data-only containers, they do not incur additional resource consumption and are only needed for convenient organization of saving data. If you are using a container with a database, then this is immediately a +1 data-only container. An application can upload files - another empty container. Sounds scary, right?
Each container is based on another container, for example, all your containers can be based on the same image, such as Debian or Ubuntu. And the peculiarity of the architecture of the container file system allows us to reuse them, which means that we will have only one base container with ubuntu for the remaining 30. Well, then, the database is usually the same for us as often (for example, in my case it is postgresql) , so that 10 containers for 10 applications becomes one container with a database and 10 dummy containers for storing application data.
Well, then, all common things are reused between containers (that is, we look at the base image).
In the case of virtual machines, we have 10 virtual machines in which 10 operating systems are running (there is only an environment in the docker, but the kernel is used at the host level), 10 databases, and so on. That is, the docker significantly reduces the amount of required resources and is generally cool.
Docker does NOT work on windows. More precisely, microsoft plans to make support for this (if it hasn't done it yet), but only for win servers. What is not ok. So linux will have to be installed in the virtual machine, but only one for all projects. As for fussing with sambas and other things - that's all you want. In general, the performance of ordinary shared folders should be enough (since we still map the data by and large to the file system of the virtual machine).
So you can just download the Docker Toolbox and get to work. For Mac OS, there's another thing called dinghy that adds transparent support for NFS and so on. but for Windows there is no such thing (only through vagrant). Ishus on this topic is hanging in the docker-machine repository and it is possible that it will be filed soon.
In fact, this is never needed, everything has already been invented before us. There is such a thing as vagrant that completely solves the issue of orchestration by virtual machines to isolate the environment. But it gives much more overhead.

G
glenean, 2016-01-14
@glenean

Yes, you can Docker, but then, more correctly, take another machine - a server, put your Linux there, Docker in it, enter the server using a graphical terminal.
In general, there are 10 virtual machines in production, and they all have a different configuration - this is not a true way.
Do you have the same database for all 10 machines or different, each with its own?
If there is one, then you can do without a docker if the web server is the same everywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question