Hi,
Where can I find ARM64 images for APM attacher ?
https://www.docker.elastic.co/r/observability/apm-agent-nodejs
Hi,
Where can I find ARM64 images for APM attacher ?
https://www.docker.elastic.co/r/observability/apm-agent-nodejs
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 site.
I am using attacher for node.js apm which uses docker.elastic.co/observability/apm-agent-nodejs 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 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 ...
Perhaps we needto build our images per Multi-platform images | Docker Docs
E.g.:
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 docker.com/blog/multi-arch-build-and-images-the-simple-way/
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/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:
% docker inspect docker.elastic.co/observability/apm-attacher:latest | rg Archi
"Architecture": "amd64",
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.