Skip to content

Commit 6d2016d

Browse files
johan-hultberg-workpataxis
authored andcommitted
fix: docker build error based on platform
1 parent 7e5d19c commit 6d2016d

File tree

9 files changed

+25
-12
lines changed

9 files changed

+25
-12
lines changed

hello-world-python/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# syntax=docker/dockerfile:1
22

33
ARG UBUNTU_VERSION=24.04
4+
ARG DEVICE_PLATFORM=linux/arm64/v8
45

5-
FROM arm64v8/ubuntu:${UBUNTU_VERSION}
6+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION}
67

78
RUN DEBIAN_FRONTEND=noninteractive \
89
apt-get update && apt-get install -y --no-install-recommends \

hello-world-python/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ Define and export the application image name in `APP_NAME` for use in the Docker
4444
```sh
4545
export APP_NAME=hello-world-python
4646

47+
# Install qemu to allow build for a different architecture
48+
docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes
49+
4750
docker build --tag $APP_NAME .
4851
```
4952

minimal-ml-inference/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
44
ARG REPO=axisecp
55
ARG IMAGE=acap-runtime
66
ARG UBUNTU_VERSION=24.04
7+
ARG DEVICE_PLATFORM=linux/arm64/v8
78

8-
FROM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
9-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS runtime-image
9+
FROM --platform=$DEVICE_PLATFORM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
10+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION} AS runtime-image
1011

1112
RUN DEBIAN_FRONTEND=noninteractive \
1213
apt-get update && apt-get install -y --no-install-recommends \

object-detector-python/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
44
ARG REPO=axisecp
55
ARG IMAGE=acap-runtime
66
ARG UBUNTU_VERSION=24.04
7+
ARG DEVICE_PLATFORM=linux/arm64/v8
78

8-
FROM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
9-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS runtime-image
9+
FROM --platform=$DEVICE_PLATFORM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
10+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION} AS runtime-image
1011

1112
RUN DEBIAN_FRONTEND=noninteractive \
1213
apt-get update && apt-get install -y --no-install-recommends \

opencv-qr-decoder-python/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
44
ARG REPO=axisecp
55
ARG IMAGE=acap-runtime
66
ARG UBUNTU_VERSION=24.04
7+
ARG DEVICE_PLATFORM=linux/arm64/v8
78

8-
FROM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
9-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS runtime-image
9+
FROM --platform=$DEVICE_PLATFORM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
10+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION} AS runtime-image
1011

1112
RUN DEBIAN_FRONTEND=noninteractive \
1213
apt-get update && apt-get install -y --no-install-recommends \

opencv-qr-decoder-python/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Define and export the application image name in `APP_NAME` for use in the Docker
4545
```sh
4646
export APP_NAME=acap-opencv-qr-decoder-python
4747

48+
# Install qemu to allow build for a different architecture
49+
docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes
50+
4851
docker build --tag $APP_NAME .
4952
```
5053

parameter-api-python/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
44
ARG REPO=axisecp
55
ARG IMAGE=acap-runtime
66
ARG UBUNTU_VERSION=24.04
7+
ARG DEVICE_PLATFORM=linux/arm64/v8
78

8-
FROM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
9-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS runtime-image
9+
FROM --platform=$DEVICE_PLATFORM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
10+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION} AS runtime-image
1011

1112
RUN DEBIAN_FRONTEND=noninteractive \
1213
apt-get update && apt-get install -y --no-install-recommends \

pose-estimator-with-flask/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
44
ARG REPO=axisecp
55
ARG IMAGE=acap-runtime
66
ARG UBUNTU_VERSION=24.04
7+
ARG DEVICE_PLATFORM=linux/arm64/v8
78

8-
FROM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
9-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} AS runtime-image
9+
FROM --platform=$DEVICE_PLATFORM ${REPO}/${IMAGE}:${RUNTIME_VERSION}-protofiles AS proto-image
10+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION} AS runtime-image
1011

1112
RUN DEBIAN_FRONTEND=noninteractive \
1213
apt-get update && apt-get install -y --no-install-recommends \

web-server/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# syntax=docker/dockerfile:1
22

33
ARG UBUNTU_VERSION=24.04
4+
ARG DEVICE_PLATFORM=linux/arm64/v8
45

5-
FROM arm64v8/ubuntu:${UBUNTU_VERSION} as runtime-image
6+
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION}
67

78
# Setup environment variables
89
ENV DEBIAN_FRONTEND=noninteractive

0 commit comments

Comments
 (0)