Can we have both ARM and x86 images in the same Docker Hub repo? - dockerhub

What's the best way to have both ARM and x86 images on Docker Hub so people can choose according to their platform? Both images should be in sync (i.e. :latest on ARM should bring the latest ARM image and :latest on x86 should bring the latest x86 image).

It's been supported now by docker a feature called manifest. Here is the reference news, FYI.

Related

How can I create a Docker image from ISO?

Unfortunately, I'm in an environment where I have to use CentOS 4.8 for business reasons.
I'd like to create an image in Docker to manage this horrible old version of OS.
I checked that some users put the image on the Docker Hub, and I checked that some images are working normally.
And the question here is, how did they create these images? Is it possible to create an image by ISO itself, or by other means, rather than an image derived from the official image distributed by Docker? (Official image exists from CentOS 5 version onwards)
and I've found that I can extract Ubuntu images from ISO through searching.
However, there is no talk of CentOS and RHEL clone OSs.
Thank you.

Quick and easy way to get around Docker's architecture image specifications?

One of the reasons that we switched to Docker a few months back was to eliminate the need of having to maintain VMs with our latest tools, etc. Figured Docker would be a lot easier to just simply pull down the image and get going. However, it's become quite a pain lately.
Doesn't run in a Windows VM (because of lack of nested VM support and requires days of troubleshooting), getting it running in RHEL has become quite painful (with some saying Docker and RHEL don't work well together), and now I'm running into a platform support issue with the Raspberry Pi 4.
When trying to run my container on the Raspberry Pi 4, it's now telling me that the container's architecture doesn't match the host's architecture.
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
A little confusing because I was hoping Docker would give us a lot more flexibility and compatibility with our customer platforms, but it seems to be quite painful.
From my understanding, we have to re-build the entire container and push out arm containers to arm systems, and amd64 to others?
Is there not just a quick and dirty workaround that I can use to get the container to run and ignore the architecture?
Shared v.s. Simple Tag
To indirectly address the issue you mentioned, you can use a shared tag that is multi-platform. You can see the difference here.
An example:
The "Simple Tags" enable docker run mongo:4.0-xenial to "do the right thing" across architectures on a single platform (Linux in the case of mongo:4.0-xenial).
The "Shared Tags" enable docker run mongo:4.0 to roughly work on both Linux and as many of the various versions of Windows that are supported
Force platform
To directly address the issue you mentioned, this warning HAS happened before to others. Check out the following bitwarden docker discussion. The fix is to force the platform when using docker run, like so:
docker run --platform linux/arm64 image_name_or_id
Make sure --platform argument is defined before the image name/id.
Building multi-platform images
docker run --platform parameter was added probably here but not to the docs! It's shown when you run docker run --help
platform string: Set platform if server is multi-platform capable
Multi-Platform Docker Builds
buildx

How do i make a multi-arch Docker Image to support two different platforms

My Docker File is based on openjdk:8-jre-alpine which is MultiArch so I can use the the exact same DockerFile and build it on Intel to build an Intel Image or an Arm32 machine to build an Arm32 image.
This works fine, but the trouble is I currently have two seperate images and the customer has to use tags to make sure they pick the right one for their platform. (Also if they use a different platform such as Arm64 then I have no image for that but that is not such a problem at the moment)
But how do I provide a single multi-arch image for both with the Supported Architectures part, which then allow customers hardware (e.g QNAP Intel/QNAP Arm) to correctly pick the right image.
For now I only need to support two platforms so I don't mind continuing building one image on Arm machine and another or Intel machine, I dont need to try to build all on one machine, which I know has complications. I just want to know how to combine them so I can provide as a multi-arch single image for the user to use.

Docker images layers built on different platforms consider different

I've noticed that the same docker images built on different platforms (OS where docker engine running) are different. For example, I used to build a heavy docker image on travis CI (ubuntu), then pull it to my local machine (macos) and when I build the image (no modifications) on my mac, it just re-used image layers from the downloaded image. It's no longer the case now, now it builds another image from the scratch. I've looked it up under docker images and saw that it switched the tag between two images built on ubuntu and macos.
Did they change it? Are docker images built on different platforms no longer compatible?
P.S. Using the same docker version (docker-ce 17.06.2)

Docker container in different HW architecture

Is it possible to have same container on my pc and on raspberry(or any other architecture)?
The reason for this is that I want to develop some web app on pc and then just put it to raspberry or any other device running docker.What will be the compatibility issues? What limits the container from being used on another arch?
Can I somehow convert between armv7/armhf-ubuntu and plain official ubuntu based image?
You can have the same Dockerfile, but you will need to build an image for each architecture.
When I say architecture, keep in mind that a Raspberry Pi, an Odroid from Hardkernel.com and a Beaglebone, are all "ARM", but are different, and will need specific images.
And of course, x86 and ARM are different.

Resources