Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between creating dockerfile for x86, armv7 32 and arm 64

I want to create dockerfile to install node and mongodb on top of alpine. How will the dockerfile differ for x86, armv7 32 and arm 64

like image 947
kumar saurav Avatar asked Jun 29 '18 06:06

kumar saurav


People also ask

Can I run x86 docker image on ARM?

Although the M1 version docker desktop allows users to run x86 docker images under emulation, it will be a more efficient solution to offer your software as a “universal” Multi-Arch docker image that can serve both your ARM (M1) and x86 users.

Can docker run on arm64?

We now have a single command to create the Docker image with multi-architecture support for the hello world PHP application for amd64, arm64, and arm32, and to store the image in Docker Hub.

Can you build arm on x86?

Setting Up ARM Emulation on x86It allows users to to build ARM CUDA binaries on your x86 machine without needing a cross compiler. The installation was successful, the emulation is working. At this point, we can now run aarch64 programs on the host x86_64 workstation.

How does docker handle different architectures?

Docker images can support multiple platforms, which means that a single image may contain variants for different architectures, and sometimes for different operating systems, such as Windows. When running an image with multi-platform support, docker automatically selects the image that matches your OS and architecture.


1 Answers

Every Dockerfile starts with a

FROM <base_image>

declaration, so you will have to choose a base image that will be able to run on your system/architecture and build on top of it.

From here:

Docker Official Images

See Docker's documentation for a good high-level overview of the program.

Architectures other than amd64?

Some images have been ported for other architectures, and many of these are officially supported (to various degrees).

  • Architectures officially supported by Docker, Inc. for running Docker: (see download.docker.com) - IBM z Systems (s390x): https://hub.docker.com/u/s390x/ - ARMv7 32-bit (arm32v7): https://hub.docker.com/u/arm32v7/ - Windows x86-64 (windows-amd64): https://hub.docker.com/u/winamd64/ - Linux x86-64 (amd64): https://hub.docker.com/u/amd64/
  • Other architectures built by official images: (but not officially supported by Docker, Inc.)
    • IBM POWER8 (ppc64le): https://hub.docker.com/u/ppc64le/
    • x86/i686 (i386): https://hub.docker.com/u/i386/
    • ARMv8 64-bit (arm64v8): https://hub.docker.com/u/arm64v8/
    • ARMv6 32-bit (arm32v6): https://hub.docker.com/u/arm32v6/ (Raspberry Pi 1, Raspberry Pi Zero)
    • ARMv5 32-bit (arm32v5): https://hub.docker.com/u/arm32v5/


  • You may also find other users/sources that use Docker Hub to upload their images. While doing some tests with ffmpeg on a Raspberry Pi, I decided to trust the images provided by resin.io (update: now they are called balena.io and here is their Docker hub: hub.docker.com/u/balena)
  • If you are interested in learning how an image is created, you can check its Dockerfile. For example for Node.js on arm64v8 see the Dockerfiles here
like image 140
tgogos Avatar answered Sep 19 '22 12:09

tgogos