<p>I trying to setup kubernetes on my local environment using docker. I've built the necessary docker image with this Dockerfile:</p>

<pre><code>FROM node:9.11.1

WORKDIR /usr/src/app
COPY package.json /usr/src/app/

RUN npm install
COPY . /usr/src/app/

EXPOSE 3002
CMD [ "npm", "start" ]
</code></pre>

<p>I then pushed this image to my private docker repo on the google cloud repository. Now i can confirm that i can push and pull the image from the cloud repo, so i then built a docker-compose using that repo as the image source file:</p>

<pre><code>version: '3'

services:
  redis:
    image: redis
    ports:
      - 6379:6379
    networks:
      - my-network

  mongodb:
    image: mongo
    ports:
      - 27017:27017
    volumes:
      - ./db:/data/db
    networks:
      - my-network

  my-test-app:
    tty: true
    image: gcr.io/my-test-app
    ports:
      - 3002:3002
    depends_on:
      - redis
      - mongodb
    networks:
      - my-network
    volumes:
      - .:/usr/src/app
    environment:
      - REDIS_PORT=6379
      - REDIS_HOST=redis
      - DB_URI=mongodb://mongodb:27017/
    command: bash -c "ls &amp;&amp; npm install"

networks:
  my-network:
    driver: bridge

volumes:
  mongodb:
</code></pre>

<p>Then finally building off of that i use Kubernetes kompose to generate my deployment file which looks like this: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.12.0 ()
  creationTimestamp: null
  labels:
    io.kompose.service: my-test-app
  name: my-test-app
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      creationTimestamp: null
      labels:
        io.kompose.service: my-test-app
    spec:
      imagePullSecrets:
        - gcr-json-key
      containers:
      - args:
        - bash
        - -c
        - ls &amp;&amp; npm install
        env:
        - name: DB_URI
          value: mongodb://mongodb:27017/
        - name: REDIS_HOST
          value: redis
        - name: REDIS_PORT
          value: "6379"
        image: gcr.io/my-test-app
        name: my-test-app
        ports:
        - containerPort: 3002
        resources: {}
        tty: true
        volumeMounts:
        - mountPath: /usr/src/app
          name: my-test-app-claim0
      restartPolicy: Always
      volumes:
      - name: my-test-app-claim0
        persistentVolumeClaim:
          claimName: my-test-app-claim0
status: {}
</code></pre>

<p>As you can see in the args section of my yaml i am listing all the files in my directory <code>/usr/src/app</code> However it logs do the only file that appears is a single <code>package-lock.json</code> file which causes the following install command to fail. This error however does not occur when i use docker-compose to launch my app so for some reason only my kubernetes is having trouble. Also i can confirm that my image does contain a <code>package.json</code> file by running an interactive shell. I'm unsure on how to proceed so any help would be appreciated!</p>

<p>You are mounting something else over <code>/usr/src/app</code> where <code>package.json</code> is supposed to be located. That hides all the files in there. Remove the <code>volumes</code> and <code>volumeMounts</code> sections.</p>
