<p>I try to run my spring-boot application in the minikube from local docker image.</p>

<pre><code>$ eval $(minikube docker-env)
$ docker build -t built_name .
$ kubectl run serviceName --image=image_name:latest --image-pull-policy=Never
</code></pre>

<p>My Dockerfile:</p>

<pre><code>FROM registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift

ARG jarFinal

ENV LC_ALL=en_US.utf8

COPY --chown=185:0 ${jarFinal} app.jar
COPY --chown=185:0 entrypoint.sh /entrypoint.sh
COPY --chown=185:0 version.json /version.json

RUN chmod +x /entrypoint.sh

EXPOSE 8080

ENTRYPOINT [ "/entrypoint.sh" ]

CMD java -Xmx256m -jar app.jar
</code></pre>

<p>After this i see in the kubernets pods logs:</p>

<pre><code>Error: Invalid or corrupt jarfile app.jar
</code></pre>

<p>But when i tried to start this jar locally, with 'RUN java -Xmx256m -jar app.jar', its starting successfully. What i do wrong? Thanks.</p>

<p>UPD: I tried to start image with local docker (docker run) and all ok, then i tried the same in minikube with minikube docker (minikube ssh -> docker run), and I get the same error 'corrupt jar'...</p>

Максим
<p>Problem solved!</p>

<pre><code>$ docker save myImage | (eval $(minikube docker-env) &amp;&amp; docker load)
$ kubectl ssh 'docker tag myImage myTag'
$ kubectl run ServiceName --image=myTag --image-pull-policy=Never
</code></pre>

<p>'docker build' crashed my image..</p>
