<p>I'm using this <code>Dockerfile</code> configuration</p>
<pre><code>FROM openjdk:17-alpine

ARG APP_HOME=/app

WORKDIR $APP_HOME

COPY ./target/ws-exec.jar ws.jar

ENV JAVA_OPTS=&quot;-Dspring.profiles.active=prod -Dspring.application.name=words&quot;

ENTRYPOINT java $JAVA_OPTS -jar ./ws.jar $JAVA_ARGS
</code></pre>
<p>After deploying it to minikube, I see the only log:
<code>Error: Unable to access jarfile /ws.jar</code>.</p>
<p>I've tried to run <code>docker run -it &lt;image&gt;</code> with my image's name, and it successfuly started with docker. Running <code>docker exec -it &lt;container&gt;</code> shew me that the <code>jar</code> is present in the right folder. I tried to make the jar executable adding a <code>CMD</code> or <code>RUN</code> layer into my <code>Dockerfile</code>, but nothing helped.
Where is my mistake, or what I don't understand?</p>
<p>UPD here is my deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: revise-words-ws
  name: revise-words-ws
  namespace: default
spec:
  replicas: 1
  minReadySeconds: 45
  selector:
    matchLabels:
      app: revise-words-ws
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: revise-words-ws
    spec:
      containers:
        - image: maxrybalkin91/revise-words-ws:1.0
          imagePullPolicy: IfNotPresent
          name: revise-words-ws
          env:
            - name: VAULT_TOKEN
              valueFrom:
                secretKeyRef:
                  name: words
                  key: vault_token
            - name: VAULT_HOST
              valueFrom:
                secretKeyRef:
                  name: words
                  key: vault_host
            - name: VAULT_PORT
              valueFrom:
                secretKeyRef:
                  name: words
                  key: vault_port
          ports:
            - name: liveness-port
              containerPort: 8089
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 300m
              memory: 512Mi
          readinessProbe:
            httpGet:
              path: /
              port: liveness-port
            failureThreshold: 5
            periodSeconds: 10
            initialDelaySeconds: 60
          livenessProbe:
            httpGet:
              path: /
              port: liveness-port
            failureThreshold: 5
            periodSeconds: 10
            initialDelaySeconds: 60
            terminationGracePeriodSeconds: 30
      restartPolicy: Always
</code></pre>

<p>As ENTRYPOINT you specify Java to run <code>./ws.jar</code>, assuming it would resolve from within work directory <code>/app</code>.
At runtime you get the error message that <code>/ws.jar</code> is not accessible, which looks like an absolute path.</p>
<p>When running your container with /bin/bash, please check out where your jar file exists and which mode it has. Then decide who is right and who is broken: Your docker file or your error message. Fix the broken one.</p>
