title: How to mount devcontainer to $HOME
body: <p>I'm trying to setup a devcontainer which mounts the workspace in VSCode to <code>/home/node</code> and puts everything in the project into $HOME in docker.</p>
  
  <p>the reason why I want to do this is so when the project mounts into docker I have everything contained in the individual projects I'm working on.</p>
  
  <p>I get an error, when running with this configuration.</p>
  
  <p>anyone have suggestions on how to achieve this?</p>
  
  <p>this is my devcontainer.json</p>
  
  <pre><code>// For format details, see https://aka.ms/vscode-remote/devcontainer.json or the definition README at
  // https://github.com/microsoft/vscode-dev-containers/tree/master/containers/typescript-node-lts
  {
    "name": "Node.js (latest LTS) &amp; TypeScript",
    "dockerFile": "Dockerfile",
    // Use 'settings' to set *default* container specific settings.json values on container create.
    // You can edit these settings after create using File &gt; Preferences &gt; Settings &gt; Remote.
    "settings": {
      "terminal.integrated.shell.linux": "/bin/bash"
    },
    // Uncomment the next line if you want to publish any ports.
    "appPort": [3000, 8000, 6006],
    // Uncomment the next line to run commands after the container is created.
    "postCreateCommand": "mkdir ~/.ssh &amp;&amp; cp .ssh/* ~/.ssh &amp;&amp; chmod 600 ~/.ssh/id_rsa",
    // Uncomment the next line to use a non-root user. On Linux, this will prevent
    // new files getting created as root, but you may need to update the USER_UID
    // and USER_GID in .devcontainer/Dockerfile to match your user if not 1000.
    "runArgs": ["-u", "node"],
    // Add the IDs of extensions you want installed when the container is created in the array below.
    "extensions": [
      "dbaeumer.vscode-eslint",
      "esbenp.prettier-vscode",
      "Orta.vscode-jest"
    ],
    "workspaceMount": "src=/home/node,dst=/home/node,type=volume,volume-driver=local",
    "workspaceFolder": "/home/node"
  }
  </code></pre>
  
  <p>and my Dockerfile</p>
  
  <pre><code>#-------------------------------------------------------------------------------------------------------------
  # Copyright (c) Microsoft Corporation. All rights reserved.
  # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
  #-------------------------------------------------------------------------------------------------------------
  
  FROM node:lts
  
  # Avoid warnings by switching to noninteractive
  ENV DEBIAN_FRONTEND=noninteractive
  
  # The node image comes with a base non-root 'node' user which this Dockerfile
  # gives sudo access. However, for Linux, this user's GID/UID must match your local
  # user UID/GID to avoid permission issues with bind mounts. Update USER_UID / USER_GID 
  # if yours is not 1000. See https://aka.ms/vscode-remote/containers/non-root-user.
  ARG USER_UID=1000
  ARG USER_GID=$USER_UID
  
  # Configure apt and install packages
  RUN apt-get update \
      &amp;&amp; apt-get -y install --no-install-recommends apt-utils dialog 2&gt;&amp;1 \ 
      #
      # Verify git and needed tools are installed
      &amp;&amp; apt-get -y install git iproute2 procps \
      #
      # Remove outdated yarn from /opt and install via package 
      # so it can be easily updated via apt-get upgrade yarn
      &amp;&amp; rm -rf /opt/yarn-* \
      &amp;&amp; rm -f /usr/local/bin/yarn \
      &amp;&amp; rm -f /usr/local/bin/yarnpkg \
      &amp;&amp; apt-get install -y curl apt-transport-https lsb-release \
      &amp;&amp; curl -sS https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/pubkey.gpg | apt-key add - 2&gt;/dev/null \
      &amp;&amp; echo "deb https://dl.yarnpkg.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
      &amp;&amp; apt-get update \
      &amp;&amp; apt-get -y install --no-install-recommends yarn \
      #
      # Install tools globally
      &amp;&amp; npm install -g jest prettier eslint typescript localtunnel \
      #
      # [Optional] Update a non-root user to match UID/GID - see https://aka.ms/vscode-remote/containers/non-root-user.
      &amp;&amp; if [ "$USER_GID" != "1000" ]; then groupmod node --gid $USER_GID; fi \
      &amp;&amp; if [ "$USER_UID" != "1000" ]; then usermod --uid $USER_UID node; fi \
      # [Optional] Add add sudo support for non-root user
      &amp;&amp; apt-get install -y sudo \
      &amp;&amp; echo node ALL=\(root\) NOPASSWD:ALL &gt; /etc/sudoers.d/node \
      &amp;&amp; chmod 0440 /etc/sudoers.d/node \
      #
      # Clean up
      &amp;&amp; apt-get autoremove -y \
      &amp;&amp; apt-get clean -y \
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  
  # Switch back to dialog for any ad-hoc use of apt-get
  ENV DEBIAN_FRONTEND=
  </code></pre>