In order to attach your Docker container to VSCode you need to install the Container Tools extension to VSCode. Link here

After the installation, you will notice the new Container icon on the left of your VSCode:

Navigate to this extension by clicking on this icon, and right-mouse-click over the appropriate container you have created:

Attaching VSCode to this container to open a new VSCode window. This new VSCode window allows you to work with your files as though you are on the machine as defined by the container. You can create and access a Terminal interface by typing Ctrl-Shift-` in the new VSCode window.

At this point, your VSCode window should be similar to the following: 1) On the left, besides the icons is an interface similar to the file explorer that you are familiar with. You can navigate around to check out the files in the file system. The two areas to the right, 2) the top-right area will display the content of any textfile you click-select in the file explorer, depending on the file-protection, you may be able to edit and save the edited file. 3) the bottom area, you will observe a command-line-interface (CLI) to the file system. This is usually referred to as a shell-interface.

Troubleshooting

The first time you attach a Docker container on your VSCode application, you make encounter the warning. It is okay to click “Got it”.