Jib 打包镜像在k8s开启Remote Debug

使用 JAVA_TOOL_OPTIONS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005

yaml配置如下

containers:
  - name: container-zk
    image: "xxxx"
    ports:
      - name: http-8080
        containerPort: 8080
        protocol: TCP
      - name: tcp-5005
        containerPort: 5005
        protocol: TCP
    env:
      - name: spring.profile.active
        value: dev
      - name: JAVA_TOOL_OPTIONS
        value: >-
          -Xdebug
          -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005

Q.E.D.