# ARM 64 APM attacher images

**URL:** <https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952>\
**Category:** APM\
**Tags:** docker, nodejs\
**Created:** [May 22, 2024, 3:25am UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952 "2024-05-22T03:25:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Garvit\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garvit_jain/32/134655_2.png) [@Garvit\_Jain](https://discuss.elastic.co/u/Garvit_Jain)\
**Post date:** [May 22, 2024, 3:25am UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/1 "2024-05-22T03:25:05Z")

</div>

Hi,

Where can I find ARM64 images for APM attacher ?

[https://www.docker.elastic.co/r/observability/apm-agent-nodejs](https://www.docker.elastic.co/r/observability/apm-agent-nodejs)

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [May 22, 2024, 9:30pm UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/2 "2024-05-22T21:30:41Z")

</div>

Hi @Garvit_Jain

Do you mean the apm-attacher image: `docker.elastic.co/observability/apm-attacher`?

Or the Docker image for the Node.js APM agent: `docker.elastic.co/observability/apm-agent-nodejs`?

Unhelpfully the former doesn't have a HTML page on the [www.docker.elastic.co](http://www.docker.elastic.co) site.

---

<div class="post-metadata">

**Author:** ![Garvit\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garvit_jain/32/134655_2.png) [@Garvit\_Jain](https://discuss.elastic.co/u/Garvit_Jain)\
**Post date:** [May 23, 2024, 10:53am UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/3 "2024-05-23T10:53:13Z")

</div>

> [@trentm](#):
>
> apm-attacher

I am using attacher for node.js apm which uses [docker.elastic.co/observability/apm-agent-nodejs](http://docker.elastic.co/observability/apm-agent-nodejs) container

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [May 23, 2024, 11:10pm UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/4 "2024-05-23T23:10:53Z")

</div>

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:

```auto
% docker run --rm -ti docker.elastic.co/observability/apm-agent-nodejs
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 README.md ...

```

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [May 23, 2024, 11:12pm UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/5 "2024-05-23T23:12:33Z")

</div>

Perhaps we needto build our images per [Multi-platform images | Docker Docs](https://docs.docker.com/build/building/multi-platform/)

E.g.:

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

```

and perhaps including more platforms than that.

---

<div class="post-metadata">

**Author:** ![Garvit\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garvit_jain/32/134655_2.png) [@Garvit\_Jain](https://discuss.elastic.co/u/Garvit_Jain)\
**Post date:** [May 24, 2024, 4:39am UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/6 "2024-05-24T04:39:15Z")

</div>

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

> **[Add a pod template annotation to each pod you want to auto-instrument | APM...](https://www.elastic.co/guide/en/apm/attacher/current/apm-webhook-add-pod-annotation.html)**

and add annotation to our nodejs kubernetes app

```auto
co.elastic.apm/attach: nodejs

```

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

```auto
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

```auto
exec /bin/cp: exec format error

```

---

<div class="post-metadata">

**Author:** ![Garvit\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/garvit_jain/32/134655_2.png) [@Garvit\_Jain](https://discuss.elastic.co/u/Garvit_Jain)\
**Post date:** [May 24, 2024, 4:47am UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/7 "2024-05-24T04:47:39Z")

</div>

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](https://github.com/elastic/apm-agent-nodejs/blob/main/package.json)

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](https://github.com/elastic/apm-agent-nodejs/actions/runs/9066565834/job/24909742514)

Then created a manifest with 2 images as shown in `docker.com/blog/multi-arch-build-and-images-the-simple-way/`

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [May 24, 2024, 9:17pm UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/8 "2024-05-24T21:17:20Z")

</div>

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:

```auto
./dev-utils/make-distribution.sh # 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 `docker.elastic.co/observability/apm-attacher:latest` 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:

```auto
% docker inspect docker.elastic.co/observability/apm-attacher:latest | rg Archi
        "Architecture": "amd64",

```

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [May 24, 2024, 9:26pm UTC](https://discuss.elastic.co/t/arm-64-apm-attacher-images/359952/9 "2024-05-24T21:26:34Z")

</div>

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