title: Vault dev mode initialization error as non-root user in alpine container: /dev/null/.vault not a directory
body: <p>The title kind of sums it up. The Dockerfile is below. I get no other errors in the build. The docker run command spits out the <code>Error initializing</code> shown below when I set the user to vault before the <code>ENTRYPOINT</code>.</p>
  
  <ul>
  <li>If I comment out <code>USER vault</code> the server starts without error.</li>
  <li>If I remove the -dev option to <code>vault server</code> but leave <code>USER vault</code> the server starts without error.</li>
  </ul>
  
  <p>What's it looking for in /dev/null, or why is it looking there? I can't turn up any references to /dev/null in any related googling.</p>
  
  <pre><code>&gt; docker build -t vault-deploy .
  &gt; docker run --rm -it --cap-add=IPC_LOCK -p 127.0.0.1:8200:8200 vault-deploy
  
  
  
           Api Address: http://0.0.0.0:8200
                   Cgo: enabled
       Cluster Address: https://0.0.0.0:8201
            Listener 1: tcp (addr: "0.0.0.0:8200", cluster address: "0.0.0.0:8201", max_request_duration: "1m30s", max_request_size: "33554432", tls: "disabled")
             Log Level: trace
                 Mlock: supported: true, enabled: false
               Storage: file
               Version: Vault v0.11.0
  
  Error initializing Dev mode: open /dev/null/.vault: not a directory
  </code></pre>
  
  <p><br>
  <strong>vault-dev-config.hcl:</strong></p>
  
  <pre><code>storage "file" {
    path = "/var/vault/data"
    }
  </code></pre>
  
  <p>(I get the same behavior if I use <code>storage "inmem" {}</code> or just let it use the default config.)</p>
  
  <p><br>
  <strong>Dockerfile:</strong></p>
  
  <pre><code>FROM [INTERNAL DOCKER IMAGE REPOSITORY]/alpine-python3
  
  # Vault is in the testing repository, edge branch.
  RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" &gt;&gt; /etc/apk/repositories
  
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # Container packages.
  # libcap: For the setcap executable.
  # - - - - - - - - - - - - - - - - - - - - - - - -
  RUN apk update \
      &amp;&amp; apk --no-cache add -u vault \
      &amp;&amp; apk add --update libcap \
      &amp;&amp; rm -rf /var/cache/apk/*
  
  
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # Execution configuration.
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # We won't run as root.
  RUN mv /usr/sbin/vault /usr/bin
  RUN chown vault /usr/bin/vault
  
  # Make sure the vault executable can run mlock to prevent swapping to disk. We
  # also have to run the container with --cap-add=IPC_LOCK.
  RUN setcap cap_ipc_lock=+ep $(readlink -f /usr/bin/vault)
  
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # Create and set ownership of /var/vault.
  # Only needed if we're putting a file storage back end here.
  # - - - - - - - - - - - - - - - - - - - - - - - -
  RUN mkdir /var/vault
  RUN chown -R vault:vault /var/vault
  
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # Create, populate and set ownership of /etc/vault.
  # - - - - - - - - - - - - - - - - - - - - - - - -
  RUN mkdir /etc/vault
  
  COPY vault-dev-config.hcl /etc/vault/vault-dev-config.hcl
  RUN chmod 600 /etc/vault/vault-dev-config.hcl
  
  RUN chown -R vault:vault /etc/vault
  
  # - - - - - - - - - - - - - - - - - - - - - - - -
  # Prepare for launch.
  # - - - - - - - - - - - - - - - - - - - - - - - -
  USER vault
  #Error initializing Dev mode: open /dev/null/.vault: not a directory
  
  ENTRYPOINT vault server \
      -dev \
      -log-level trace \
      -dev-listen-address 0.0.0.0:8200 \
      -config /etc/vault/vault-dev-config.hcl
  </code></pre>