How do i know my CPU supports Docker? - docker

What are now Docker cpu requirements for running in Linux, say, Ubuntu and Windows?
Is VT-x/AMD-v is enough or VT-d/AMD-Vi is required too?
Does it require MMU virtualization (Intel's Extended Page Tables (EPT) and Unrestricted Mode, and AMD's Nested Page Tables (NPT) and Rapid Virtualization Indexing (RVI)) like Hyper-V?
Would Xeons with VT-x like 53xx, 54xx run both 32-bit and 64-bit docker images, or just 32-bit or none of them in say, Ubuntu?
May be there is some tool to check for compatibility?

Containers aren't virtual machines. VT-x is not required to run a container. Docker require's certain Linux kernel features. If you have a Linux system on a 3.10+ kernel and a x86-64 CPU, you can run Docker 17.09+.
Windows Server containers require Windows Server build 1709, Windows Server 2016 (Core and with Desktop Experience) and Windows 10 Professional and Enterprise (Anniversary Edition) (all 64bit).
If you want to use Hyper-V Containers, which provide more isolation than Windows Server containers, then you will need to meet Hyper-V's virtualisation requirements.

Related

Are containers specific to a host OS?

Are containers specific to a particular host OS? For instance, if a container is created on Windows with particular dependencies (e.g., DLL files), can it run in a setup in which the host OS is Linux? I initially assumed that a container must be specific to a particular host OS.
But the following two excerpts seem to suggest that I may not have understood the mechanics correctly. So my question is: are containers built over the docker engine so when the dependencies are included, they are relative to the docker engine and the underlying host OS does not matter?
(1) From IBM:
Containerization allows developers to create and deploy applications faster and more securely. With traditional methods, code is developed in a specific computing environment which, when transferred to a new location, often results in bugs and errors. For example, when a developer transfers code from a desktop computer to a virtual machine (VM) or from a Linux to a Windows operating system. Containerization eliminates this problem by bundling the application code together with the related configuration files, libraries, and dependencies required for it to run. This single package of software or “container” is abstracted away from the host operating system, and hence, it stands alone and becomes portable—able to run across any platform or cloud, free of issues. [https://www.ibm.com/cloud/learn/containerization]
(2) From Docker:
Does Docker run on Linux, macOS, and Windows?
You can run both Linux and Windows programs and executables in Docker containers. The Docker platform runs natively on Linux (on x86-64, ARM and many other CPU architectures) and on Windows (x86-64).
Docker Inc. builds products that let you build and run containers on Linux, Windows and macOS.
What does Docker technology add to just plain LXC?🔗
Docker technology is not a replacement for LXC. “LXC” refers to capabilities of the Linux kernel (specifically namespaces and control groups) which allow sandboxing processes from one another, and controlling their resource allocations. On top of this low-level foundation of kernel features, Docker offers a high-level tool with several powerful functionalities:
Portable deployment across machines. Docker defines a format for bundling an application and all its dependencies into a single object called a container. This container can be transferred to any Docker-enabled machine. The container can be executed there with the guarantee that the execution environment exposed to the application is the same in development, testing, and production. LXC implements process sandboxing, which is an important pre-requisite for portable deployment, but is not sufficient for portable deployment. If you sent me a copy of your application installed in a custom LXC configuration, it would almost certainly not run on my machine the way it does on yours. The app you sent me is tied to your machine’s specific configuration: networking, storage, logging, etc. Docker defines an abstraction for these machine-specific settings. The exact same Docker container can run - unchanged - on many different machines, with many different configurations.
The host OS, or precisely, the kernel provided still matters. That's why you can't run Windows containers on Linux. You can run Linux container on Windows due to Hyper-V and WSL2, and on macOS with Hypervisor, but that's it. If the provided kernel is compatible (doesn't have to be identical), usually similar version and the same architecture (remember, there are x64, ARM64, etc) or at least supported virtualization (x64 containers can run on M1, which is ARM64) then you can just run the container, no need to worry about DLLs because they're supposed to be included either in one of the base image you start with or the image you generate.

Nesting Hyper-V with a VM (i.e. Docker Windows Desktop within a VM)?

On a physical server with Windows Server 2019 Enterprise, I created Hyper V multiple VMs, both Servers and Win 10 Pro client.
I installed Docker Desktop (for Windows) on one of the Win 10 Pro VM clients.
The client virtual machine name is the Hyper-V Manager. I get an error when I try to start DockerDesktopVM, and the state remains off; any Docker command crashes Docker.
My questions:
Is there a conflict when nesting Hyper-V managers and VMs on the physical box?
How can you execute any docker commands when the DockerDesktopVM is off and cannot be started?
https://www.altaro.com/hyper-v/enable-nested-virtualization/
Q: How Do I Enable Nested Virtualization for Hyper-V Virtual Machines
A: Pass $true for Set-VMProcessor’s “ExposeVirtualizationExtensions” parameter
Set-VMProcessor <VMName> -ExposeVirtualizationExtensions $true
According to Docker FAQ
Docker Desktop is not supported in nested virtualization scenarios. It
might work in some cases and not in others.
https://docs.docker.com/desktop/faqs/general/#can-i-run-docker-desktop-in-nested-virtualization-scenarios
It should work even on AMD, according to MicrosoftDocs/Virtualization-Documentation issue 1276:
"Run Hyper-V in a Virtual Machine with Nested Virtualization"
Prerequisites
...
AMD EPYC/Ryzen processor or later
The Hyper-V host must be Windows Server 2022/Windows 11 or greater
VM configuration version 10.0 or greater
And:
What's new in Windows Server 2022
Nested virtualization is a feature that allows you to run Hyper-V inside of a Hyper-V virtual machine (VM).
Windows Server 2022 brings support for nested virtualization using AMD processors, giving more choices of hardware for your environments.
More information can be found at the nested virtualization documentation.

docker installation editions? for hyper v enabled PC

I have windows 10 home edition. I checked my hyper v capabilites of the machine.all four of it says ÝES. Should I get the docker for windows or the toolbox. I am confused.
See official guide: just follow them, don't try to make any hacker as I think this maybe waste effort to do that. For you, choose docker toolbox please.
README FIRST for Docker Toolbox and Docker Machine users: Docker Desktop for Windows requires Microsoft Hyper-V to run. The Docker Desktop for Windows installer enables Hyper-V for you, if needed, and restarts your machine. After Hyper-V is enabled, VirtualBox no longer works, but any VirtualBox VM images remain. VirtualBox VMs created with docker-machine (including the default one typically created during Toolbox install) no longer start. These VMs cannot be used side-by-side with Docker Desktop for Windows. However, you can still use docker-machine to manage remote VMs.
System Requirements:
Windows 10 64bit: Pro, Enterprise or Education (Build 15063 or later).
Virtualization is enabled in BIOS. Typically, virtualization is enabled by default. This is different from having Hyper-V enabled. For more detail see Virtualization must be enabled in Troubleshooting.
CPU SLAT-capable feature.
At least 4GB of RAM.
Note: If your system does not meet the requirements to run Docker Desktop for Windows, you can install Docker Toolbox, which uses Oracle Virtual Box instead of Hyper-V.
You won’t be able to use Docker Desktop for Windows Home edition. Docker Desktop supports professional edition not the home edition. The only option you have is Docker Toolbox.
Enter to your BIOS, and try to enable Virtualization Technology(Vtx) or AMD-V

linux driver development: How does docker make sure app version matches kernel version?

On linux, when I wish to develop a driver(character device or block device),I'll need to make sure I develop upon corresponding kernel version. Each linux distribution like centos6.8 has its kernel version like 2.6.32
But seems on docker, all images share the same, new kernel version of moby4.9.2. So it seems that only develop normal applications on docker is valid, but not programs like drivers or any management applications that should visit /dev or other system level resources.
So is docker linux designed to develop system program? If there's no way to specify which kernel version and device structure should be used, seems docker is only for normal user applications?
My question is: how to develop programs like drivers on docker and apply to production linux distributions?

Running docker and 64 bit linux VM on my host windows10

As you all know Docker runs natively on windows 10 OS. This requires Hyper-V to be enabled. I did that and docker is running fine on my win 10. I wanted to run a 64 bit linux VM on my win 10. So I downloaded the oracle virtual box and ubuntu iso and when I opened the oracle vb it was showing only 32-bit guest versions. When I checked the online info, it recommends to turn off the Hyper-V for 64-bit guest versions to appear. I did that and was able to install the 64 bit ubuntu VM on my win 10 but it broke my docker running on win 10.
Is there any way where we can have both docker running and 64 bit virtual machine installed and running on my guest win 10 OS ??
It is not possible to run Hyper-V and Virtualbox at the same time. If Hyper-V is installed on the system then VT-x is not available for VirtualBox.
I have heard of workarounds, that make switching easy, but you have to reboot the system every time.
Ubuntu is supported on Hyper-V. This question on Microsoft forums suggests Hyper-V doesn't really care if you install a 32 bit or 64 bit OS in the virtual machine.
There are a lot of tutorials online on how to create a Hyper-V Linux virtual machine, 5 steps to create Ubuntu Hyper V Image seems as good as any.
Is there any way where we can have both docker running and 64 bit virtual machine installed and running on my guest win 10 OS ??
Double-check with VirtualBox 6.0.x (starting Dec. 2018):
the ten-years old ticket 4032 "[feature-request] Nested Virtualization: VT-in-VT" is still active
there is now an "experimental feature":
2.34. Using Hyper-V with Oracle VM VirtualBox
Oracle VM VirtualBox can be used on a Windows host where Hyper-V is running. This is an experimental feature.
No configuration is required. Oracle VM VirtualBox detects Hyper-V automatically and uses Hyper-V as the virtualization engine for the host system. The CPU icon in the VM window status bar indicates that Hyper-V is being used.
Note
When using this feature, you might experience significant Oracle VM VirtualBox performance degradation on some host systems.

Resources