한승욱
한승욱

Reputation: 71

Is it possible to install 32 bit container in 64 bit host, or the other ways?

I’m try to use picamera, raspistill on raspberry pi. I recognized that these modules are Only work in 32bit os. But I want to use another development that works in 64bit os.

So my question is this. Is it possible to make or install container that is different from host os?

  1. Host: 32bit, Container: 64bit
  1. Host: 64bit, Container: 32bit

Upvotes: 3

Views: 5108

Answers (1)

Michael Dreher
Michael Dreher

Reputation: 1399

There is a feature to run multiple architectures on the same kernel. I use this to run i386 binaries in an amd64 container on an amd64 host OS/kernel.

Debian call this Multiarch. I haven't tried this on arm, but in theory this could work the same as on Intel.

Look at the Multiarch HOWTO:

  1. use a base container for an architecture in your Dockerfile, e.g. image=debian:buster-slim
  2. add another architecture: dpkg --add-architecture armhf
  3. update package list: apt-get update
  4. install the tools and libraries for the respective architecture (e.g. armhf or arm64): apt-get install -y yourpackage:armhf

As I said I only used that for i386, there might be more pitfalls with arm.

/edit: I use the same now also for a ARM64 Linux running armhf binaries (32 bit) in a docker container.

Upvotes: 1

Related Questions