Skip to content

Commit cab7506

Browse files
authored
Publish javaagent docker image (#194)
* Publish image with javaagent Signed-off-by: Pavol Loffay <[email protected]> * Use make Signed-off-by: Pavol Loffay <[email protected]> * fix make Signed-off-by: Pavol Loffay <[email protected]>
1 parent de8763c commit cab7506

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ jobs:
7070
- setup_build_environment
7171
- run: echo "Releasing version" && ./gradlew printVersion
7272
- run: ./gradlew publish
73+
- run: DOCKER_TAG=${CIRCLE_TAG} make docker docker-push
7374
- run:
7475
name: "Copy artifacts to workspace"
7576
command: |

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
DOCKER_IMAGE ?= hypertrace/javaagent
2+
DOCKER_TAG ?= latest
3+
4+
.PHONY: assemble
5+
assemble:
6+
./gradlew assemble --stacktrace
17

28
.PHONY: build
39
build:
@@ -13,6 +19,14 @@ muzzle:
1319
# for injecting helper classes from the same packages as instrumentations
1420
./gradlew muzzle --no-daemon
1521

22+
.PHONY: docker
23+
docker: assemble
24+
docker build -f javaagent/Dockerfile javaagent/ -t ${DOCKER_IMAGE}:${DOCKER_TAG}
25+
26+
.PHONY: docker-push
27+
docker-push:
28+
docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
29+
1630
.PHONY: test
1731
test:
1832
./gradlew check

javaagent/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# This is a dockerfile that contains the Hypertrace javaagent.
2+
# This image can be used to get the javaagent into app images or
3+
# as Kubernetes init container to copy the javaagent into the volume mounted into the
4+
# application container.
5+
6+
FROM hypertrace/java:11
7+
8+
LABEL maintainer="Hypertrace 'https://www.hypertrace.org/'"
9+
10+
ENV JAVAAGENT=/opt/hypertrace/hypertrace-agent-all.jar
11+
COPY build/libs/hypertrace-agent-*-all.jar ${JAVAAGENT}
12+
13+
# The following binaries are used by sidecar injector
14+
# This statement tests if they exists in the image
15+
RUN which base64
16+
17+
# env vars are not interpreted
18+
CMD ["/opt/hypertrace/hypertrace-agent-all.jar"]

0 commit comments

Comments
 (0)