我正在尝试为我的在GKE中运行的应用安装GCP Profiler代理,请按照此处的说明进行操作:https://cloud.google.com/profiler/docs/profiling-java
我无法克服此错误。有人可以帮忙吗?
在以下位置找不到代理库/opt/cprof/profiler_java_agent.so 绝对路径,有错误:重新定位错误 /opt/cprof/profiler_java_agent.so:__pthread_key_create:initial-exec TLS解析为动态定义 /opt/cprof/profiler_java_agent.so
这是Dockerfile
FROM openjdk:8-jdk-alpine
RUN apk update && apk add --no-cache gcompat
RUN apk update && apk add --no-cache libc6-compat
WORKDIR /app
# The application's jar file
ARG JAR_FILE=target/example-svc-*.jar
# Add the application's jar to the container
ADD ${JAR_FILE} example-svc.jar
EXPOSE 5050
RUN mkdir -p /opt/cprof && \
wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \
| tar xzv -C /opt/cprof
ENTRYPOINT ["java", \
"-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=example-svc,-cprof_service_version=0.0.1-SNAPSHOT", \
"-jar", "/app/example-svc.jar"]
答案 0 :(得分:2)