You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: This bug report has been produced with chatGPT, however it is accurate to the extent of my understanding.
Description
When attempting to build the services for the dYdX V4 Indexer, specifically using indexer/Dockerfile.service.local, the build fails due to a platform architecture mismatch. The Dockerfile is using the base image dydxprotocol/indexer-node:16-alpine-m1, which is built for linux/arm64. However, the local machine or Docker setup is expecting an image built for linux/amd64.
The Docker build should succeed without a platform mismatch error.
Actual Behavior
The Docker build fails with the following error:
InvalidBaseImagePlatform: Base image dydxprotocol/indexer-node:16-alpine-m1 was pulled with platform "linux/arm64", expected "linux/amd64" for current build (line 2)
Dockerfile.service.local:6
This error occurs because the base image dydxprotocol/indexer-node:16-alpine-m1 was pulled with platform linux/arm64, but the expected platform is linux/amd64.
Proposed Solution
To resolve this issue for Ubuntu (amd64), the base image in indexer/Dockerfile.service.local should be changed from dydxprotocol/indexer-node:16-alpine-m1 to an amd64 compatible version, such as:
FROM node:16-alpine
This change ensures that the correct platform image is used, avoiding the exec format error during the build.
Note: This solution is specific to Ubuntu (amd64) and may not work for ARM-based systems (e.g., Mac M1/M2). To support multiple architectures, a platform-agnostic solution using Docker's buildx feature or multi-platform images should be considered.
Environment
OS: Ubuntu 22.04
Node.js Version: v22.9.0
Docker Version: Latest
pnpm Version: 9.12.0
Logs
> [ 2/28] RUN apk add --no-cache bash jq aws-cli:
0.263 exec /bin/sh: exec format error
------
1 warning found (use docker --debug to expand):
- InvalidBaseImagePlatform: Base image dydxprotocol/indexer-node:16-alpine-m1 was pulled with platform "linux/arm64", expected "linux/amd64" for current build (line 2)
Dockerfile.service.local:6
--------------------
4 | ARG service
5 |
6 | >>> RUN apk add --no-cache bash jq aws-cli
7 | RUN adduser -S dydx
8 | RUN mkdir -p /home/dydx/app
--------------------
ERROR: failed to solve: process "/bin/sh -c apk add --no-cache bash jq aws-cli" did not complete successfully: exit code: 1
ERROR: Service 'ender' failed to build : Build failed
Additional Information
This issue is specific to the platform mismatch between arm64 and amd64 architectures in the Docker base image used in indexer/Dockerfile.service.local.
The text was updated successfully, but these errors were encountered:
josusanmartin
changed the title
Bug Report: Docker Image Build Fails Due to exec format error (Platform Mismatch)
Indexer: Docker Image Build Fails Due to exec format error (Platform Mismatch)
Oct 4, 2024
Disclaimer: This bug report has been produced with chatGPT, however it is accurate to the extent of my understanding.
Description
When attempting to build the services for the dYdX V4 Indexer, specifically using
indexer/Dockerfile.service.local
, the build fails due to a platform architecture mismatch. The Dockerfile is using the base imagedydxprotocol/indexer-node:16-alpine-m1
, which is built forlinux/arm64
. However, the local machine or Docker setup is expecting an image built forlinux/amd64
.Steps to Reproduce
indexer
directory.Expected Behavior
The Docker build should succeed without a platform mismatch error.
Actual Behavior
The Docker build fails with the following error:
This error occurs because the base image
dydxprotocol/indexer-node:16-alpine-m1
was pulled with platformlinux/arm64
, but the expected platform islinux/amd64
.Proposed Solution
To resolve this issue for Ubuntu (amd64), the base image in
indexer/Dockerfile.service.local
should be changed fromdydxprotocol/indexer-node:16-alpine-m1
to anamd64
compatible version, such as:FROM node:16-alpine
This change ensures that the correct platform image is used, avoiding the
exec format error
during the build.Environment
Logs
Additional Information
This issue is specific to the platform mismatch between
arm64
andamd64
architectures in the Docker base image used inindexer/Dockerfile.service.local
.The text was updated successfully, but these errors were encountered: