Developing inside a Container (VSCode)

use a Docker container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code’s full feature set. - Getting started

  • Remote-Containers: Open Folder in Container
  • Reopen Folder localy (exit)

create .devcontainer/devcontainer.json

{
    "image": "ydu/remarkable-toolchain"
}

or refering to Dockerfile

{
    "dockerFile": "Dockerfile",
    "remoteUser": "yves",
    "mounts": [
        "source=/home/yves/DEV/reMarkable/cairo,target=/home/yves/DEV/reMarkable/cairo,type=bind,consistency=cached"
      ]
}

Then => Remote-Containers: Reopen in Container

Docker-compose can be use as well.

Adding a non-root user to your dev container

.devcontainer/Dockerfile can be used to add user definition

FROM ydu/remarkable-toolchain

ARG USERNAME=yves
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
    && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
Written on February 5, 2021, Last update on October 8, 2021
vscode docker