Sign inSign up

harshavardhanj/binfmt

By harshavardhanj

Updated about 6 years ago

Docker image with `binfmt` package to enable QEMU binfmt support.

Image
2

10K+

harshavardhanj/binfmt repository overview

binfmt Docker Image

Docker Image Size (tag) MicroBadger Layers (tag) Docker Pulls

In case you find this image to be useful, please consider clicking the link below to say thanks! Thank you.
saythanks

NOTE:

Apart from the aforementioned images, there are other images that contain untested as part of their tag. Do not use these images. As the tag suggests, they are present for purposes of testing. In order to test the images with container-structure-test and trivy, the image needs to be present in a public repository. Therefore, I first build and push the images with an untested tag. Then, I run tests on these images. When the image passes all tests, it is built again and pushed with the appropriate tags.

Quick Reference

Software Packages Installed

This image contains the following binaries

  • binfmt
  • qemu-aarch64
  • qemu-arm
  • qemu-armeb
  • qemu-i386
  • qemu-ppc64le
  • qemu-s390x

and the following file

  • 00_linuxkit.conf

added to the scratch base image. From a security standpoint, one does not have to worry about exploits or vulnerabilities(apart from any present in the qemu binaries) as the scratch base image is used(no OS). Apart from the aforementioned binaries and configuration file, no other files are present on the image.

Supported Architectures

  • amd64
  • arm64
  • ppc64le
  • i386
  • s390x

Image Description

This image is used to enable binfmt support in order to help build multi-architecture container images. Using this, one can leverage the capabilties of buildx in Docker in order to build container images for multiple architectures without having to make any changes to the Dockerfile.

Description of Tags

latest, stable

The images with the latest tag and stable tag are, for all intents and purposes, the same. As description of what is present in the image is given in the Software Package Installed section.

testing

This image differs in the way that any new features or changes will first be introduced under this tag. Only after extensive usage and testing will the image be graduated to the stable/testing tag. It is inadvisable to images with this tag unless you want some new feature that has not yet been implemented in the stable/latest tag.

How to use this image

Register the binfmt image by running the following command on the machine that has Docker installed.

$ docker run --rm --privileged harshavardhanj/binfmt:stable

Then, get the qemu-user-static binary by running the following command.

$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

Now, you can build multi-architecture images using the buildx utility in Docker. The command given below illustrates this:

$ docker buildx build -t [repository_name]/[image_name]:[image_tag] --platform \
linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -f [path/to/Dockerfile] \ [/path/to/directory/containing/Dockerfile/.]

NOTE:

The last argument to the buildx command must be the ‘build context’ which is the path to the directory that contains the Dockerfile. The path is supposed to end with a period(.) as can be seen in the aforementioned command.

This way, the binfmt image can be used to build multi-arch images.

Variants

The binfmt image comes in only one variant, which comes in three tags(stable, latest, and testing). All of them are built on top of the scratch base image.

License

As with all Docker images, these likely also contain other software which may be under other license (such as bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained.)

As for any pre-built image usage, it is the image user’s responsibility to ensure that any use of this image complies with any relevant licenses for all software container within.

The license for the code pertaining to the Docker container for binfmt is

Tag summary

Content type

Image

Digest

Size

7.9 MB

Last updated

about 6 years ago

docker pull harshavardhanj/binfmt