You can run any image in a container from within VS Code. VS Code also provides functionality for inspecting, managing and otherwise working with images and containers on your machine.
Run the "i-love-lamp:latest" image from the Docker Explorer in VS Code
View the application running on port 3000
Attach a shell to the running image and inspect the file system
Open the Docker Explorer view by clicking on the Docker icon in the Activity Bar
In the "images" section, locate the "i-love-lamp" image. Expand it to find the "latest" image.
Right-click the image and select "Run"
Notice that there is now a container running
Open your browser and navigate to "http://localhost:3000"
View the application running in the Docker container
Right click the container in the "Containers" section of the Docker Explorer view and select "View Logs"
View the logs from the container
Right click the container in the "Containers" section of the Docker Explorer view and select "Attach Shell"
The integrated terminal will open connected to the Docker container
Navigate the file system with cd
to change directory and ls
to list the file system contents
Right click the container in the "Containers" section of the Docker Explorer view and select "Stop"
Right click the container in the "Containers" section of the Docker Explorer view and select "Remove"
The container will be removed from the "Containers" section in VS Code