An Ubuntu 24.04 development environment configured to run as root. It includes
common build, Git, editing, and network diagnostic tools. The project is set up
to work as a VS Code Dev Container.
- Docker Desktop or another running Docker Engine
- For the VS Code workflow: Visual Studio Code and the Dev Containers
extension (
ms-vscode-remote.remote-containers)
- Open this project folder in Visual Studio Code.
- Run Dev Containers: Reopen in Container from the Command Palette
(
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Linux/Windows). - VS Code builds the image from the root
Dockerfileand opens the project inside the container. The project is available at/workspace. - Open a VS Code terminal to work in the container. It uses Bash and runs as
root.
The first build downloads Ubuntu and installs the packages listed in the
Dockerfile. If you change the Dockerfile or .devcontainer/devcontainer.json,
run Dev Containers: Rebuild Container from the Command Palette.
Run these commands from the project directory to build the image, start a
container with the project mounted at /workspace, and open a root shell:
docker build -t linux-dev-container .
docker run -d --name linux-dev-container \
-v "$PWD:/workspace" \
-w /workspace \
linux-dev-container
docker exec -it linux-dev-container bashWhen finished, exit the shell and stop the container:
exit
docker stop linux-dev-containerStart the stopped container again with docker start linux-dev-container, then
connect with docker exec -it linux-dev-container bash. To remove it when you
no longer need it, run docker rm linux-dev-container.
The base image is Ubuntu 24.04. The Dockerfile installs Bash, Git, a C/C++
build toolchain, curl, OpenSSH client tools, and common network and process
diagnostics, along with nano, vim, and less. Add other project-specific
tools to the Dockerfile and rebuild the container.
- This environment intentionally runs as
root. Commands inside it have elevated privileges within the container; use care with scripts and mounted files. - In the VS Code workflow, the project files live on the host and are mounted into the container. In the direct Docker workflow above, the explicit volume mount does the same. Changes to those files persist on the host.
- Changes made only to the running container (for example, installing a package interactively) are not part of the image and may be lost when the container is removed. Add required tools to the Dockerfile and rebuild to make them repeatable.