How do I create a SUSE 10 Docker Image? - docker

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.

Related

Power shell and GitBash shows the different docker image in windows OS

Hi I have installed docker desktop on my Windows machine.
If I list the docker image using Powershell or Docker Desktop or Cmd I can see the some set of docker images.
I can view the same in Git bash. I am not able to view the docker image listed by Powershell. But I am able to view some different image.
What config I need to update to get the same docker images from PowerShell and GitBash
How can I use the minikube using the docker image from my local system.
It is best to not mix up the Git for Windows bash shell, and the native Powershell.
The %PATH% might be different in a Powershell from Docker, and a bash shell from Git.
you can therefore follow "Getting started with Docker and Kubernetes on Windows 10" from Keith Mifsud, using WSL2 or Hyper-V
See also "Install Minikube in Windows 10 via Docker Desktop 2021 Version"

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

Creating container image of old Centos

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.

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