9

In the .devcontainer directories that VSCode uses to build dev images, e.g. the Python 3 one here, they always have a Docker file and a base.Docker file. The base.Docker file is not referenced by either the Docker file nor the devcontainer.json file. What is it for?

dumbledad
  • 16,305
  • 23
  • 120
  • 273
  • Yes, but I do not understand it :-( Once copied locally into my repository, why would I reconfigure *devcontainer.json* to use *base.Docker* and then edit *base.Docker*, rather than just editing my local copy of the *Docker* file directly? – dumbledad Jul 29 '21 at 07:52

1 Answers1

7

base.Dockerfile is the "recipe" used by Microsoft to generate the image used in Dockerfile. In this case, this is mcr.microsoft.com/vscode/devcontainers/jekyll:0-${VARIANT}, specied in the FROM section at the top of Dockerfile.

They state that if you want to customize the image, that you can replace the FROM with the contents of base.Dockerfile. This is described here: https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/jekyll#using-this-definition

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53