I am studying the course "Docker Essentials: A Developer Introduction" in "cognitiveclass.ai" and one of the questions was "What tool makes it possible to run Docker containers on operating systems other than Linux?" and the choices where: LinuxByte, OSContainers, Docker Swarm and Linuxkit.
But no matter how much I looked for the answer I couldn't find anything that explain this problem clearly.
I know that Docker Swarm is a tool for managing a cluster of container, also Docker uses Linux virtual machine to run containers on mac and hyper-v for windows.
Its Linuxkit. Docker containers are based on linux containers, so you need to have linux to run them. Linuxkit came as a solution for that.
Read this article to get some idea.
Related
Let say I want run Linux application on Windows laptop. (Let say the application is Mongo and it MUST be Linux Mongo). I have 2 options
I can use VirtualBox to run Linux virtual machine with application
I can use Docker for Windows to run Linux docker image with application
My question is: which solution is expected to have better performance? VirtualBox virtual machine has well known overhead, docker instance is a process with low overhead. But between laptop Windows and docker instance AFAIU Docker for Windows establish intermediate virtual machine with Linux (Hyper-V VM?)
Stack looks similar for both options. Could I say that some option has definitely better performance/resource requirements or it depends on specific details?
I would suggest use Docker instead of VirtualBox.
Docker is like independent platform, in future if you want to run on Mac, Linux or windows you just need to copy few files from one place to other to get it set up everything but with VirtualBox you need to copy whole image or re-configured everything.
Docker provides built-in support for all kind of base images, which will help you to get speedy development.
With the Docker, you can destroy or re-run image with few/one command.
Docker provides an easy way to map local folders with VirtualBox you need to configure that.
VirtualBox is heavy as compared with Docker.
In Docker, you will always get the fresh/clean environment if you decide to use Continuous Deployment.
Network mapping (port externalise) and many more things are easily available with Docker.
Again lastly Go with Docker :)
Hope this get you clear idea, Please let me know if you need any help to setup Docker environment for your development.
I'm trying to learn Docker and came to know of term Container. I am bit confused, in most of the online materials which I referred to (understand Docker), the term Container appears somewhere.
Can anyone help me understand what is the difference between Docker and Container and is Docker one of the implementations of Container?
Thanks in advance.
A Container is essentially a package(with an embedded application) that can be run anywhere. A Container allows a developer to package an application with all of the dependencies it needs, and ship it as one package.
At a lower level, a Container is an operating system level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel. LXC(Linux Containers) combines the kernel's cgroups and support for isolated namespaces to provide an isolated environment for applications.
Docker is a tool that was designed to make it much easier to create, deploy, and run applications in containers, rather than using LXC(Linux Containers) directly.
All docker's are containers not all containers are docker.
docker is a strict subset of containers.
A container is a generic term, like you said, docker is a particular implementation of a container system.
Could you pls help me to understand how VMWare VIC actually works?
I'm familiar with Docker, and has very basic overview of CoreOS. Docker is your environment container which increase your app portability, whereas CoreOS is very lightweight Linux system, which has a bare minimum to launch Docker container.
In other hand, there are lots of virtual machines (e.g. VMWare), which are so heavy that humanity had to invent Docker. The only VM's benefit over Docker is that it's more secure.
Questions:
So why trying to put Docker inside virtual machine? In other words, why do you need VIC?
How can virtual machine be "small"? Isn't it a container than?
Why do you need additional layer like Photon OS? Why not just start Docker instances directly from VM. Docker inside OS, OS inside VM sounds like an overhead?
I've played with VIC for sometime and I try to answer your question.
Lets imagine VIC as a docker daemon you can send commands like ps,run etc Usually VIC has lots of resources assigned. When VIC receive a run command it will spawn a new VM with demanded profile. You can provide how much memory and cpu should have assigned via docker arguments. The docker runs in this small VM spawned exclusively for the docker container. So it's grated that each container will run in its own VM. When you stop the container the VM is shut down as well. The VIC has implemented all features of docker so far e.g. volumes, network... except exec command.
Well, it's just design that can be considered as an overhead. VIC creates for each container it's own VM which runs the container. I believe this "a hack" to provide old fashioned VMware tools for docker ecosystem.
Definitely, this is an overhead, but it's nothing significant I suppose. You can have a look into Photon Controller which should be the product without the additional layer. But it has not support for VMware tools yet.
I'd would say it has some pros and cons:
PROS:
VIC spawns new VM automatically with desired cpu and mem profiles
VIC can be controlled via native docker calls
VIC supports other VMware products. Monitoring, storages, networking
CONS:
List item
VIC has some bugs in docker implementation or its not working the same way as native docker. So its hard to integrate it with others systems like mesos, marathon.
VIC supports only 1.23 docker API version
VIC doesn't support exec command
I installed Docker and kitematic. I had VirtualBox before that and used many machines on Vbox. Docker is working, I can pull containers and other stuff like that. Like this link : https://docs.docker.com/mac/started/
I can add containers by:
<i> docker run docker/whalesay cowsay boo </i>
I want to know if there is any way that I can import some of my Vbox machines into docker as a Container locally?
I have ova and ovf file in my local pc. I don't wanna get involved with online containers! Is there any way to accomplish this.
Thank you.
Looks like you have some confusion on the concept of a container.
A container is not a virtual machine.
You can't import virtual machines into Docker. What you can do is build and run a Docker container which eliminates the need for a virtual machine (depending on your use case of course).
You can find a good explanation about the difference between a container and a virtual machine here.
TL;DR:
Both virtual machines and containers allow you to run multiple applications on a shared hardware.
When using virtual machines, the hardware is shared among all applications, however each application runs on a separate operating system.
When using containers, both the hardware AND the operating system are shared, and each application runs in a separate container.
This is in no way an exhaustive explanation regarding Docker containers - there are MANY more advantages to using Docker instead of a virtual machine (portability, consistency, infrastructure-as-code). This is just the main difference between them.
My understanding of Linux Containers (LXC) is that it provides a native hypervisor for Linux systems, similar to Windows' Hyper-V introduced in Windows 8. By "native hypervisor", I mean, the ability for the Linux system to host guest VMs inside of it without having to install any kind of specialized virtualization software.
My understanding of Docker is that it somehow builds on top of LXC, and allows application developers to define:
The exact app stack of a VM/node, including the OS, the exact configuration and tuning of the OS, and any tools or applications installed/configured/deployed to that OS; and
The exact resource requirements for running this VM/node, including CPU requirements, memory/disk/network requirements, load balancing and replication requirements, etc. Docker then figures out what nodes to run the container on, using these declared requirements as its baseline.
So first off, if my understanding of LXC or Docker is mislead at all, please begin by correcting me!
Assuming I'm more or less correct in my understanding, I ask:
What is the relationship between Docker and, say, vmWare or Xen VMs? Does Docker "sit on top" of the virtualization layer? In other words, are there "Docker bindings" for different virtualization platforms (vmWare, Xen, kvm, etc.), and I could take a Docker container for myapp and deploy it to any Docker-ified platform?
What is the relationship between LXC and Docker? Does Docker simply just extend LXC, or is it a similar (but completely separate) concept altogether? If its an extension of LXC, then in what way?
relationship between LXC and Docker, -> docker started using LXC, but since docker 0.9, docker uses libcontainer, and no longer uses lxc-start to start the containers. Compared to LXC, docker offers a REST Api, allows to move images from and to the registry, allows to build using Dockerfiles...