ARM 64 APM attacher images


Where can I find ARM64 images for APM attacher ?

Hi @Garvit_Jain

Do you mean the apm-attacher image:

Or the Docker image for the Node.js APM agent:

Unhelpfully the former doesn't have a HTML page on the site.

I am using attacher for node.js apm which uses container

Do you get a particular failure that you can show? The Node.js APM agent parts of that image are not platform-dependent -- just JavaScript code. However, I understand that the image has "Architecture": "amd64", so perhaps it breaks with certain usages?

On my ARM macOS machine I'm able to use the image, though I get a warning from Docker. For example:

% docker run --rm -ti
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/ # ls /opt/nodejs/node_modules/elastic-apm-node/
LICENSE        ...

Perhaps we needto build our images per Multi-platform images | Docker Docs


docker build --platform linux/amd64,linux/arm64 .

and perhaps including more platforms than that.

We have our Node.js app running on kubernetes. To add elastic agent to that, we use APM attacher

and add annotation to our nodejs kubernetes app

co.elastic.apm/attach: nodejs

this starts another container in the pod and runs the following command:

cp -v -r /opt/nodejs/node_modules/elastic-apm-node /elastic/apm/agent

this command works if both the containers are same and fails if one container is amd64 and another is arm64

the error we get is

exec /bin/cp: exec format error

The command docker build --platform linux/amd64,linux/arm64 .

will work if there are no amd64 specific dependencies in apm-agent-nodejs/package.json at main · elastic/apm-agent-nodejs · GitHub

I did not check that, rather, I built arm64 image on arm machine using the commands found on release 4.5.4 (#4018) · elastic/apm-agent-nodejs@f1fea2e · GitHub

Then created a manifest with 2 images as shown in

Ah. Thanks very much for the specific error. It is with /bin/cp, which is indeed platform specific. It is from the alpine image that the apm-agent-nodejs Docker image is using as a base.

Alpine itself is multi-platform. Playing locally, I'm able to build a multi-platform image for the APM agent via roughly this:

./dev-utils/   # script that creates "./build/dist/nodejs/"
docker buildx create --name builder --driver=docker-container
docker buildx build --builder builder --build-arg AGENT_DIR=/build/dist/nodejs --platform linux/amd64,linux/arm64 --push -t $IMAGE_NAME:$IMAGE_TAG .

and this should be easy with the GitHub action we are already using.
I'll get an issue and PR open for this for the next APM agent release.

@Garvit_Jain I'm curious whether you also had an issue with the image that is used by the APM attacher Helm chart. This is the image that holds the mutating webhook that handles adding container config to add the APM agents.

Currently that image is single-platform, and not ARM:

% docker inspect | rg Archi
        "Architecture": "amd64",

make docker image(s) multi-platform and include linux/arm64 · Issue #4038 · elastic/apm-agent-nodejs · GitHub created to track this.