把Arthas安装到基础镜像里

FROM openjdk:8-jdk-alpine
# copy arthas
COPY --from=hengyunabc/arthas:latest /opt/arthas /opt/arthas

诊断Docker里的Java进程

docker exec -it  ${containerId} /bin/bash -c "wget https://alibaba.github.io/arthas/arthas-boot.jar && java -jar arthas-boot.jar"

诊断k8s里容器里的Java进程

kubectl exec -it {pod} --container{containerId} -- /bin/bash -c "wget https://alibaba.github.io/arthas/arthas-boot.jar && java -jar arthas-boot.jar"

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code