<p>I am currently trying to access a file mounted in my Kubernetes container from a docker image. I need to pass the file in with a flag when my docker image is run.</p>

<p>The docker image is usually run (outside a container) using the command:</p>

<p><code>docker run -p 6688:6688 -v ~/.chainlink-ropsten:/chainlink -it --env-file=.env smartcontract/chainlink local n -p /chainlink/.password -a /chainlink/.api</code></p>

<p>Now I have sucessfully used the following config to mount my env, password and api files at /chainlink, but when attempting to access the files during the docker run I get the error:</p>

<p><code>flag provided but not defined: -password /chainlink/.password</code></p>

<p>The following is my current Kubernetes Deployment file</p>

<pre><code>kind: Deployment
metadata:
  name: chainlink-deployment
  labels:
    app: chainlink-node
spec:
  replicas: 1
  selector:
    matchLabels:
      app: chainlink-node
  template:
    metadata:
      labels:
        app: chainlink-node
    spec:
      containers:
        - name: chainlink
          image: smartcontract/chainlink:latest
          args: [ "local", "n", "--password /chainlink/.password", "--api /chainlink/.api"]
          ports:
          - containerPort: 6689
          volumeMounts:
            - name: config-volume
              mountPath: /chainlink/.env
              subPath: .env
            - name: api-volume
              mountPath: /chainlink/.api
              subPath: .api
            - name: password-volume
              mountPath: /chainlink/.password
              subPath: .password
      volumes:
        - name: config-volume
          configMap:
            name: node-env
        - name: api-volume
          configMap:
            name: api-env
        - name: password-volume
          configMap:
            name: password-env
</code></pre>

<p>Is there some definition I am missing in my file that allows me to access the mounted volumes when running my docker image?</p>

<p>Change your <code>args</code> to:</p>

<pre><code>args: [ "local", "n", "--password", "/chainlink/.password", "--api", "/chainlink/.api"]
</code></pre>

<p>The way you currently have it, it's thinking the whole string <code>--password /chainlink/.password</code>, include the space, is a single flag.  That's what the error:</p>

<pre><code>flag provided but not defined: -password /chainlink/.password
</code></pre>

<p>is telling you.</p>
