Creating container image of old Centos - docker

I need to create Centos 6.9 32bit system image. I found manual how to do that which contains link to script.
I suppose for this reason I need to run Centos 6.9 32bit, install docker in it and then run script.
Trying to install docker in Centos 6.9 and. Found that it is not possible to install on this system according to requarements in manual:
OS requirements
To install Docker CE, you need a maintained version of CentOS 7
How to create container for of old Centos 6.9 ?

There is already an official CentOS 6 32-bit image in Docker Hub, so you might not need to create your own. It can run on an x64 host.
There is no centos:6.9 tag but a quick test of the centos:6 tag shows that it is 6.9 anyway:
$ docker pull i386/centos:6
6: Pulling from i386/centos
6fe27d5f397b: Pull complete
Digest: sha256:af47b24bee01b29f3c86e484b716651f89c93d8ca73d88c1a74019c691e0d1e2
Status: Downloaded newer image for i386/centos:6
$ docker run -it i386/centos:6 bash
[root#508467e5637e /]# cat /etc/redhat-release
CentOS release 6.9 (Final)
Update
I see from your previous question that you had already found the official 32-bit CentOS 6 image but want it to run on a 32-bit host kernel.
According to the docker installation prerequisites, it needs a 64-bit host. Docker does have 32-bit packages but they only contain the docker client and not the daemon.
If you want to run a 32-bit version of the docker-daemon, you could try following this blog post which describes how to build it from source.

Related

Docker linux versions [duplicate]

This question already has answers here:
$(uname -a) returning the same in docker host or any docker container
(2 answers)
Closed 1 year ago.
I am learning docker basics. I created a simple image
FROM alpine
RUN apk add --update redis
CMD ["redis-server"]
I started the container and logged in using
docker exec -it c57389dc94f5 sh
From the shell prompt, if I execute
more /etc/alpine-release
I get 3.14.2.
If I execute
more /proc/version
I get
Linux version 5.4.0-84-generic (buildd#lgw01-amd64-050) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021
Why am I getting Ubuntu when the image uses Alpine?
/cat/proc give you the version of the OS which hosts the docker container, and not the docker image version. Remember that docker is not a virtual machine, but a bunch of isolated processes, named container, running on top of the hosting OS (and so, by its own kernel).
I guess that you are using docker on Ubuntu. Is it right?
Please refer to official docker containers architecture.

Docker for Windows and WSL1 to Work together

Exactly the same problem as Ubuntu WSL with docker could not be found
$ docker
The command 'docker' could not be found in this WSL 1 distro.
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.
See https://docs.docker.com/docker-for-windows/wsl/ for details.
But my requirement is different -- I want to
stick with WSL1 (for reasons beyond this topic)
and use Docker for Windows as-is
I.e., I have WSL1 and Docker for Windows installed parallel to each other. This is my current info:
C:> ver
Microsoft Windows [Version 10.0.18363.1379]
C:> wsl -l -v
NAME STATE VERSION
* Debian Running 1
I don't see integration in "Resources -> WSL Integration", and I don't have WSL2 backend enabled in Docker Desktop settings.
Just that I'm getting the above problem -- my docker works anywhere, in CMD, Powershell, git-bash, etc, just not in my WSL.
All solutions that I found are to install Docker for Windows within WSL1 or WSL2, but I want to keep everything as is -- WSL and Docker for Windows installed parallel to each other.
Any solution for that?
The command 'docker' could not be found in this WSL 1 distro.
We recommend to convert this distro to WSL 2 and activate
the WSL integration in Docker Desktop settings.
This means in WSL2, it has a real linux kernel which is required to install docker daemon, then in docker-desktop you could have chance to set docker daemon in WSL2. Otherwise, the docker daemon is running in Hyper-V machine. But, if you stick in WSL1, no chance to run docker-daemon in WSL, so the only option is running docker daemon in Hyper-V machine.
Although above is the fact, still we have chance to let you operate docker ps, docker pull etc. in WSL1 bash just like you operate through CMD, Powershell, git-bash, that is allow Docker to accept requests from remote hosts.
For your case, the steps maybe next:
1. Expose docker daemon in docker desktop settings as next, then click Apply & Restart:
2. Install standalone docker client in WSL1:
$ wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.5.tgz
$ tar zxvf docker-20.10.5.tgz
$ cd docker
3. Set default docker daemon:
$ export DOCKER_HOST=tcp://localhost:2375
4. Verify docker client command:
$ ./docker info
Just FTA, this is the quick hacky workaround that I found, while trying to solve it myself
Change the C:\Program Files\Docker\Docker\resources\bin\docker file to
#!/usr/bin/env sh
#
# Copyright (c) Docker Inc.
binary=$(basename "$0")
"$binary.exe" "$#"
Then docker can work anywhere now, in CMD, Powershell, git-bash, and as well as WSL1.
Note that this hacky workaround is specially for the situation described in OP, might not work for anything else.
I ran the same issue with Ubuntu 20 Distro when trying to use Docker. Below are steps i followed to resole it:
1- I went to microsoft Store and downloaded a recent distro version of the distro, that was Ubuntu 22.04
2- On powershell as admin, i ran the command wsl -l -v to make sure i have the new version
PS C:\WINDOWS\system32> wsl -l -v
NAME STATE VERSION
* Ubuntu Stopped 1
Ubuntu-22.04 Stopped 2
docker-desktop-data Stopped 2
docker-desktop Stopped 2
3- i ran the command: wsl --set-default Ubuntu-22.04 to use wsl 2
I wan now able to use Docker on WSL 2

what is the workaround for the kernel too old error in docker on centos

I just started dockering and here hits my very first docker question.
I am using CentOS release 6.6 (Final).
I need to build a docker image for JupyterHub, here is the JupyterHub image: https://hub.docker.com/r/jupyterhub/jupyterhub/, what I did is:
docker pull jupyterhub/jupyterhub
And then I ran:
sudo docker images
, I see the following:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
jupyterhub/jupyterhub latest 3726912b8cfc 5 months ago 811.5 MB
<none> <none> 7cdb3c49d61f 2 years ago 4.766 GB
What is the huge none repo that comes with an image id?
When I ran:
sudo docker run --name test 3726912b8cfc
I received:
FATAL: kernel too old
What does it mean? and how to work around with it?
Redhat pulled support for docker on el6 a long time ago. See https://access.redhat.com/solutions/1378023
The 1.7 version of Docker that is in those repositories hasn't received updates since the backport effort was pulled.
Modern Docker images tend to not be tested against old versions of Docker and they could require a newer kernel than centos 6 provides.
The upstream Docker project only provides packages for Centos 7 as of the time of writing of this answer (https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements)
To install Docker CE, you need a maintained version of CentOS 7
Since 2017, running Docker on centos tends to require centos 7 instead of centos 6 for practical usecases.

How do I create a SUSE 10 Docker Image?

SUSE 10 SP 3 is unsupported on Docker and my goal is to create a custom image out of a SUSE 10 SP 3 iso file.
I have tried installing the iso into a VirtualBox VM and creating a tar archive, but as the OS itself is unsupported by Docker, I cannot use the docker import command and pass the tar file.
I have also tried using xorriso in an Ubuntu container, but I am having trouble running docker inside the Ubuntu container in order to use the docker import command.

Unable to pull ubuntu image using docker on windows host

I have installed docker on windows 10.
Docker version:
Docker version 17.09.0-ce, build afdb6d4
I tried to pull latest ubuntu and ubuntu:16.04 using the bellow two commands
docker pull ubuntu
docker pull ubuntu:16.04
But I am getting the below error.
docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
no matching manifest for windows/amd64 in the manifest list entries
So is there any way to fix this issue?
You can't run linux images with a windows daemon.
If you are running Docker for Windows, it gives you the ability to switch between running a Windows Docker daemon and a Linux Docker daemon inside a hyper-v VM.
To run Linux workloads, make sure you have chosen "Switch to Linux Containers" in the Docker for Windows whale icon menu.
please follow the Docker tutorial here
In this case the problem is it requires adding the --experimental flag when starting dockerd.exe.

Resources