How to build docker image on a destination host?

Viewed 32

I did a docker build using: docker build --pull -t ${CONTAINER} -f ci/Dockerfile-${CONTAINER} .

The above command is exiting with error status 132. The issue is that this image cannot be built on this machine as it is run on an older CPU architecture.

Running on a newer CPU architecture works, but is there a way to change the Dockerfile to rebuild image on a destination host with a newer CPU architecture? Or to pass any option to docker build command to be able to build image on a newer CPU architecture?

Dockerfile:

  FROM ubuntu:22.10
  ENV DEBIAN_FRONTEND    noninteractive

  RUN apt-get update -qq
  RUN apt-get update -qq && apt-get install -y gcc g++ 
  COPY . /build/
  WORKDIR /build

Error message:

# docker build -t ubuntu-22.10 --file ci/Dockerfile-ubuntu-22.10 /home/tool/
Sending build context to Docker daemon  4.106MB
Step 1/9 : FROM ubuntu:22.10
 ---> f67d6c081259
Step 2/9 : ENV DEBIAN_FRONTEND    noninteractive
 ---> Using cache
 ---> 07c6b9ab005e
Step 3/9 : RUN apt-get update -qq
 ---> Running in 5d1da0d150e1
The command '/bin/sh -c apt-get update -qq' returned a non-zero code: 132
0 Answers
Related