The command line instructions shown here are based on a Linux-based development environment. The .devcontainer at the root of this project template defines and provisions (through VS Code) all the dependencies necessary to run these commands. It is assumed that you run these commands by accessing the command line prompt either through the VS Code Terminal or through the Docker shell of the .devcontainer run by VS Code.
- VS Code Terminal:
View -> Terminal
- Execute a bash shell inside the running container:
Replace
docker exec -it <container-name> bash
<container-name>
with the name or ID of the running container you want to access.
Currently, the .devcontainer provisions Debian Linux, and running lsb_release -a
should return:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
We need to switch the context a little bit for dealing with the container defined under dev
. Here, we are building and running a container inside the container defined by .devcontainer
.
-
Build the Docker container:
docker-compose build
-
Start the Docker container in detached mode:
docker-compose up -d
-
Save a Docker image as a tar file:
docker save -o <path-to-save-tar-file> <image-name>
Replace
<path-to-save-tar-file>
with the desired path and filename for the tar file, and<image-name>
with the name of the Docker image you want to save. -
Load a Docker image from a tar file:
docker load -i <path-to-tar-file>
Replace
<path-to-tar-file>
with the path to the tar file you want to load.