Skip to content

feat(devcontainer): add Dev Container configuration for reproducible … - #975

Open
Princess0407 wants to merge 1 commit into
urunc-dev:mainfrom
Princess0407:add-devcont-cfgs
Open

feat(devcontainer): add Dev Container configuration for reproducible …#975
Princess0407 wants to merge 1 commit into
urunc-dev:mainfrom
Princess0407:add-devcont-cfgs

Conversation

@Princess0407

Copy link
Copy Markdown

Description

Right now, getting started with urunc requires manually installing Docker, QEMU, containerd, CNI plugins, and Go across different package managers and manual steps. This is documented in the installation guide, but it's a significant barrier for new contributors and LFX mentees who just want to run make unittest or make lint.
A Dev Container automates that same setup into a reproducible, version controlled environment.

What's added

  • .devcontainer/devcontainer.json : configures the container with Docker in Docker, KVM passthrough (--device=/dev/kvm), and VS Code extensions for Go development
  • .devcontainer/Dockerfile : Ubuntu 22.04 base image with Go, QEMU, containerd, CNI plugins, and build tools pre installed
  • .devcontainer/post-create.sh : runs after container creation to set up git safe directory and download Go modules

How to use it

Local VS Code + Docker (recommended for full e2e testing):

  1. Install the Dev Containers extension in VS Code
  2. Open the project and run "Dev Containers: Reopen in Container"
  3. The container gets KVM access, so VM based e2e tests can work if VMMs are installed manually

GitHub Codespaces:

  • Supports make unittest, make lint, and build workflows
  • e2e tests that spawn VMs (Firecracker/QEMU) are not available because Codespaces standard instances don't support nested virtualization/KVM

Verification

Tested locally with docker build and docker run:

docker build -f .devcontainer/Dockerfile -t urunc-dev-test .
docker run --rm -it -v $(pwd):/workspace -w /workspace urunc-dev-test bash

Test results

make unittest was run inside the dev container. The test suite passes overall with 3 pre existing failures that are unrelated to this PR:

Failing test Reason
TestCopyFile/copy_file_target_dir_creation_failed Test expects mkdir to fail with permission denied, but root can create any directory
TestCopyFile/copy_file_target_file_creation_failed Test expects read-only filesystem error, but root ignores read-only flags
TestMoveFile/move_file_target_file_creation_failed Same read only filesystem assumption fails under root

These failures occur whenever tests run as root (which the dev container does) and are not introduced by this PR. They are existing issues in pkg/unikontainers/utils_test.go.

Inside container:

bash .devcontainer/post-create.sh
make unittest   
make lint       

Related

Fixes #953

…development

Adds Dev Container configuration to provide a reproducible, one click development environment for urunc.

Files added:
- .devcontainer/devcontainer.json
- .devcontainer/Dockerfile
- .devcontainer/post-create.sh

The dev container supports 'make unittest' and 'make lint' out of the box.KVM passthrough is enabled for local VS Code + Docker environments.GitHub Codespaces supports unit tests and linting (e2e tests requiring KVM are not available in Codespaces due to lack of nested virtualization).

Signed-off-by: Priyanka Tiwari <priyankatiwari140419@gmail.com>
@netlify

netlify Bot commented Aug 15, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit 6e40190
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a80a82e69d6af0008585b4a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add Dev Container configuration for reproducible development environment

2 participants