Repository navigation
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
51 lines (40 loc) · 1.65 KB
/
Copy pathDockerfile.alpine
File metadata and controls
51 lines (40 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# BTrace Docker Image - Alpine variant
# Smaller footprint for Kubernetes sidecars and resource-constrained environments
FROM alpine:3.24
ARG BTRACE_VERSION=3.0.0-SNAPSHOT
LABEL maintainer="BTrace Project <https://github.com/btraceio/btrace>" \
org.opencontainers.image.title="BTrace Alpine" \
org.opencontainers.image.description="Safe, dynamic tracing tool for the Java platform (Alpine variant)" \
org.opencontainers.image.url="https://github.com/btraceio/btrace" \
org.opencontainers.image.source="https://github.com/btraceio/btrace" \
org.opencontainers.image.version="${BTRACE_VERSION}" \
org.opencontainers.image.licenses="Apache-2.0"
# Install OpenJDK 21 and required tools
RUN apk add --no-cache \
openjdk21-jdk \
bash \
procps \
curl \
ca-certificates
# Create BTrace installation directory
RUN mkdir -p /opt/btrace
# Copy BTrace distribution
COPY btrace/ /opt/btrace/
# Set ownership and permissions
RUN chmod -R 755 /opt/btrace/bin && \
chmod 644 /opt/btrace/libs/*.jar
# Set environment variables. Alpine's base image sets no JAVA_HOME;
# /usr/lib/jvm/default-jvm is the symlink apk maintains to the installed JDK.
ENV BTRACE_HOME=/opt/btrace \
PATH="${PATH}:/opt/btrace/bin" \
JAVA_HOME=/usr/lib/jvm/default-jvm
# Verify installation: the launchers must actually run, or the build fails
RUN test -x "${JAVA_HOME}/bin/java" && \
btrace --version && \
btracec --version
# Add entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
WORKDIR /work
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/bin/bash"]