I am interested in creating a Docker image from Ubuntu 16.04 (Kernel 4.15.0-29-generic) to be run on a CentOS 6.9 (Kernel 2.6.32-696.30.1.el6.x86_64).
Are they compatible to run smoothly?
Thank you for your help!
CentOS 6 will not run any version of Docker "smoothly"; the last Docker version that even has a build for CentOS 6 is very old and even then there are kernel compatibility issues. I'd update your host to something newer.
Once you get past that, there aren't usually any substantial issue running different Linux distributions between the host and in containers. You'll routinely see hosts running very minimal distributions (for instance there isn't much in the boot2docker distribution that Docker Machine VMs use), and images frequently run very light-weight distributions such as Alpine or even have nothing resembling a "Linux distribution" at all.
Related
I'm experimenting with the new docker setup on macOS Monteray. To be short I've moved docker daemon into VirtualBox, here is some setup details:
Vagrant + VirtualBox (with the latest Ubuntu LTS);
Dockerd runs on Ubuntu (inside VirtualBox);
I have docker client on the host (macOS)
Host and guest docker client versions are matching
I've built images from my java project within VB and everything works fine.
I did exactly the same, but from host os, and as a result, I have some serious performance degradation with newly built images.
Can anyone explain why this happens and how to overcome these issues?
I'm trying to install docker into a server that has freebsd OS, the version of freebsd is 10.3-RELEASE-p17. I want to know if docker is compatible with this version of freebsd and also how can I install it?
Thanx in advance.
Docker won't work of FreeBSD(at least as of now). Docker was built built for Linux- it uses the isolation features of the linux kernel. There have been ongoing efforts to have a working port but there's nothing concrete(for the past 9 months). If you'd want to run docker, you'd have to use a VM and run docker from that VM using docker-machine(which is ports). I've mentioned virtualbox because it's supported by docker-machine.
What I mean is if I can run for example the official docker image DEBIAN and on top of that
run the official docker image NGINX with both same supported architecture e.g. Linux x86-64?
Will it work like I would install NGINX package for DEBIAN operating systems in non-docker way?
Because I'm learning docker and I've came across that NGINX was build and run from official NGINX repository for DEBIAN OS on top of the official docker image DEBIAN?
Is that a clue that docker images are not cross-platform compatible?
I've also came across this helpful question.
If by cross-platform you mean whether a docker image built on an x86_64 machine will run on a ppcle64 machine, then the answer is no (there are ways around it by using an emulator, but generally speaking the answer is no).
If you mean, whether an Ubuntu container can be run on a Debian host, then yes (provided host kernel version is compatible, which it will be, since you were able to install docker).
As for the question of why NGINX official image is Debian, the developers might have their own reasons. In fact, the official repo has Alpine flavour image as well. You can modify the Dockerfile to use Ubuntu image, make the necessary modifications (such as the ubuntu version of the installer) and build it on a Debian host. It will produce an Ubuntu image which will run an Ubuntu container on any Linux, Unix, MacOS or Windows (using Linux VM) . You can build that Dockerfile as is on an Ubuntu host and it will create the same nginx:latest image as you would download from dockerhub. This can be verified using the checksum.
I have a openvz vps which is centos 7 but with a 2.6 kernel. I know this is not compatible with docker. I have another KVM vps which has docker on it. Is there anyway to access docker in KVM remotely using my openvz vps? Basically I want my openvz box to be my dev machine and Ill deploy to KVM docker. What would be an ideal setup above?
You say the host has a 2.6.x kernel, but that covers a couple different releases. I have made docker work in an openvz VPS on a host with 2.6.32 kernel (derived from RedHat el6) but it would probably not work for kernels 2.6.18 or 2.6.9 (you really should upgrade if you have 2.6.9 as that is based on RedHat el4 kernel, 2.6.18 should be fine until 3/2017). You can find instructions to make it work with a compatible kernel at the openvz wiki. WARNING: docker does not perform very well in this configuration (2.6.32 kernel, CentOS 7 VPS) as you do not get any of the fancy filesystem layering functionality since you are forced to use the "vfs" storage engine. Each layer of the docker container will be a full copy of its underlying filesystem, grossly ballooning disk usage for images with lots of layers.
If you are not running a docker compatible kernel, you would not be able to run any of the docker tools at all, so your options are limited. If you still want to develop docker containers on your VPS to move to your KVM, you could use chroot and yum/rpm to construct your container and make a ${docker_image}.tgz file on your VPS and then copy that to your KVM and import into docker.
Hope that helps.
I am running a RHEL 7 server and I am deploying containers using docker. Since you need to have RHEL servers and containers registered with RHN, I am now thinking of using centos7 docker images rather than RHEL7 ones, to avoid the RHN hassles.
Can anybody see any downside to doing it this way?
Since the kernel is the same you can use any distro available: Why docker has ability to run different linux distribution?.
For example many projects are moving to Alpine Linux because it give you the ability to build very small images: see Docker Official Images are Moving to Alpine Linux.