elastic / apm-agent-java

https://www.elastic.co/guide/en/apm/agent/java/current/index.html
Apache License 2.0
562 stars 320 forks source link

github-actions: refactor docker #3626

Open v1v opened 1 month ago

v1v commented 1 month ago

What does this PR do?

Use https://docs.docker.com/build/building/multi-stage/ to generate the Docker image. This will help using Docker natively to fetch the artifacts with some build-args (whether using the standalone files or fetching from Sonatype given the release version). This will make the Docker image agnostic to the host.

In addition, it removes the complexity of using shell scripts. and use native GitHub action support with tag and label detection.

Generate docker images for the snapshots using the docker tag name test-latest.

Finally, this will help us provide some provenance for the docker images, which was not done as docker build/push was in shell scripts.

Checklist

SylvainJuge commented 1 month ago

The https://github.com/elastic/apm-agent-java/pull/3652 PR is also likely to introduce a few other conflicts, but the underlying issue might be implicitly fixed by only downloading and not as a fallback of the local build.