Skip to content

Commit

Permalink
fix: docker build error based on platform (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-olsson-work authored and pataxis committed Nov 1, 2024
1 parent 7e5d19c commit 36de15c
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 12 deletions.
3 changes: 2 additions & 1 deletion hello-world-python/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1

ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

FROM arm64v8/ubuntu:${UBUNTU_VERSION}
FROM --platform=$DEVICE_PLATFORM ubuntu:${UBUNTU_VERSION}

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
3 changes: 3 additions & 0 deletions hello-world-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Define and export the application image name in `APP_NAME` for use in the Docker
```sh
export APP_NAME=hello-world-python

# Install qemu to allow build for a different architecture
docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes

docker build --tag $APP_NAME .
```

Expand Down
5 changes: 3 additions & 2 deletions minimal-ml-inference/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
ARG REPO=axisecp
ARG IMAGE=acap-runtime
ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
5 changes: 3 additions & 2 deletions object-detector-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
ARG REPO=axisecp
ARG IMAGE=acap-runtime
ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
5 changes: 3 additions & 2 deletions opencv-qr-decoder-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
ARG REPO=axisecp
ARG IMAGE=acap-runtime
ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
3 changes: 3 additions & 0 deletions opencv-qr-decoder-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Define and export the application image name in `APP_NAME` for use in the Docker
```sh
export APP_NAME=acap-opencv-qr-decoder-python

# Install qemu to allow build for a different architecture
docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes

docker build --tag $APP_NAME .
```

Expand Down
5 changes: 3 additions & 2 deletions parameter-api-python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
ARG REPO=axisecp
ARG IMAGE=acap-runtime
ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
5 changes: 3 additions & 2 deletions pose-estimator-with-flask/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ ARG RUNTIME_VERSION=2.0.0
ARG REPO=axisecp
ARG IMAGE=acap-runtime
ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get install -y --no-install-recommends \
Expand Down
3 changes: 2 additions & 1 deletion web-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# syntax=docker/dockerfile:1

ARG UBUNTU_VERSION=24.04
ARG DEVICE_PLATFORM=linux/arm64/v8

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

# Setup environment variables
ENV DEBIAN_FRONTEND=noninteractive
Expand Down

0 comments on commit 36de15c

Please sign in to comment.