Skip to content

Commit

Permalink
NH-90479: add building auto-instrumentation docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
cleverchuk committed Sep 19, 2024
1 parent 051ef5c commit 5d8a717
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 2 deletions.
38 changes: 37 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -508,4 +508,40 @@ jobs:
echo "AGENT_VERSION=${{ steps.set_version.outputs.version }}.$GIT_HASH" >> $GITHUB_ENV
- name: Publish
run: ./gradlew publish
run: ./gradlew publish

docker_hub:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Set agent version
id: set_version
uses: ./.github/actions/version

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_CI_USER }}
password: ${{ secrets.DOCKER_HUB_CI_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: agent
platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
tags: solarwinds/autoinstrumentation-java:${{ steps.set_version.outputs.version }},solarwinds/autoinstrumentation-java:latest
40 changes: 39 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,42 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.set_version.outputs.version }}
VERSION: ${{ steps.set_version.outputs.version }}

docker_hub:
runs-on: ubuntu-latest
needs: github_release
name: Deploy to docker hub
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set agent version
id: set_version
uses: ./.github/actions/version

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_CI_USER }}
password: ${{ secrets.DOCKER_HUB_CI_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
context: agent
platforms:
- linux/amd64
- linux/arm64
- linux/ppc64le
- linux/s390x
tags:
- solarwinds/autoinstrumentation-java:${{ steps.set_version.outputs.version }}
- solarwinds/autoinstrumentation-java:latest
11 changes: 11 additions & 0 deletions agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To build one auto-instrumentation image for Java, please:
# - Download your customized `javaagent.jar` to `/javaagent.jar`. This is required as when instrumenting the pod,
# one init container will be created to copy the jar to your app's container.
# - Grant the necessary access to the jar. `chmod -R go+r /javaagent.jar`
# - For auto-instrumentation by container injection, the Linux command cp is
# used and must be availabe in the image.
FROM busybox

ADD build/libs/solarwinds-apm-agent.jar /javaagent.jar

RUN chmod -R go+r /javaagent.jar

0 comments on commit 5d8a717

Please sign in to comment.