<p>I am trying to debug a java app on GKE cluster through stack driver. 
I have created a GKE cluster with <code>Allow full access to all Cloud APIs</code>
I am following documentation: <a href="https://cloud.google.com/debugger/docs/setup/java" rel="nofollow noreferrer">https://cloud.google.com/debugger/docs/setup/java</a> </p>

<p>Here is my DockerFile:</p>

<pre><code>FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} alnt-watchlist-microservice.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/alnt-watchlist-microservice.jar"]
</code></pre>

<p>In documentation, it was written to add following lines in DockeFile:</p>

<pre><code>RUN  mkdir /opt/cdbg &amp;&amp; \
     wget -qO- https://storage.googleapis.com/cloud-debugger/compute-java/debian-wheezy/cdbg_java_agent_gce.tar.gz | \
     tar xvz -C /opt/cdbg

RUN java -agentpath:/opt/cdbg/cdbg_java_agent.so 
    -Dcom.google.cdbg.module=tpm-watchlist
    -Dcom.google.cdbg.version=v1
    -jar /alnt-watchlist-microservice.jar
</code></pre>

<p>When I build DockerFile, It fails saying tar: invalid magic , tar: short read.</p>

<p>In stackdriver debug console, It always show 'No deployed application found'. Which application it will show? I have already 2 services deployed on my kubernetes cluster.</p>

<p>I have already executed 
<code>gcloud debug source gen-repo-info-file --output-directory="WEB-INF/classes/</code>
in my project's directory.</p>

<p>It generated source-context.json. After its creation, I tried building docker image and its failing.</p>

Roobal Jindal
<p>The debugger will be ready for use when you deploy your containerized app. You are getting <code>No deployed application found</code> error because your debugger agent is failing to download or unzip in dockerfile.</p>

<p>Please check <a href="https://unix.stackexchange.com/questions/302192/how-to-solve-tar-invalid-magic-error-on-linux-alpine">this discussion</a> to resolve the <code>tar: invalid magic , tar: short read.</code> error.</p>
