Skip to content
Advertisement

Error while building docker image on ARM64

I wrote this Dockerfile for an os

FROM randomdude/gcc-cross-x86_64-elf
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y nasm
RUN apt-get install -y xorriso
RUN apt-get install -y grup-pc-bin
RUN apt-get install -y grup-common
VOLUME /
WORKDIR /

and while running sudo docker build buildenv -t testos-buildenv on the terminal i got this log Sending build context to Docker daemon 2.048kB Step 1/9 : FROM randomdude/gcc-cross-x86_64-elf —> c7e17c42eb04 Step 2/9 : RUN apt-get update —> [Warning] The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested —> Running in 32e48dbf4a9c exec /bin/sh: exec format error The command ‘/bin/sh -c apt-get update’ returned a non-zero code: 1

this file is inside /home/user/Desktop/os-systems/test-os/buildenv

i need help to solve it

Advertisement

Answer

Of course..It is for x86.

It depends on what you want to do.

If you want use it on your os. You have to build an arm64 version image. You have to replace some x86 dependences in the original Dockerfile and re-build it.

This Dockerfile is mentioned by the base image’s description you use.

If you want use a x86 image but just want to build it on your OS (arm64), then you could try to use buildx.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement