Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

# netplan dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
Comment thread
benhoyt marked this conversation as resolved.
bash-completion \
build-essential \
cmake \
gcovr \
libcmocka-dev \
libglib2.0-dev \
libsystemd-dev \
libyaml-dev \
meson \
network-manager \
pandoc \
pkg-config \
pycodestyle \
pyflakes3 \
python3-cffi \
python3-coverage \
python3-dev \
python3-pytest \
python3-pytest-cov \
python3-yaml \
systemd \
udev \
uuid-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# devcontainer dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN echo "ubuntu ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/ubuntu \
&& chmod 0440 /etc/sudoers.d/ubuntu

WORKDIR /workspace

USER ubuntu
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Netplan Development",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"remoteUser": "ubuntu"
}
30 changes: 30 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Hacking Guide

## Container Usage

### Manual Docker Workflow

Build the development image:

```sh
$ docker build -t netplan-dev -f .devcontainer/Dockerfile .
```

Run an interactive shell:

```sh
$ docker run -it --rm -v "$(pwd):/workspace" --name netplan-dev netplan-dev bash
```

Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
### VS Code Dev Container

A devcontainer is provided under `.devcontainer/`.

1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
2. Open this repository in VS Code.
3. Run `Dev Containers: Reopen in Container` from the Command Palette.

## Notes

- The Docker image is useful for reproducible builds and many tests.
- Some system-level integration scenarios (for example, full network service lifecycle behavior) are better exercised in LXD or VM-based environments.
Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,41 @@ To contribute documentation, these steps should get you started:

If you face issues, refer to our [comprehensive contribution guide](https://netplan.readthedocs.io/en/stable/contribute-docs/).

# Development Container

A Docker-based development environment is available via `.devcontainer/` for consistent builds across machines.

Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
For development workflows (including VS Code container usage), see [HACKING.md](HACKING.md).

# Build dependencies

Install the required build and test dependencies (Ubuntu/Debian):
For a manual setup without containers, install the required build and test dependencies:

```sh
sudo apt install \
$ sudo apt install \
Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
bash-completion \
Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
build-essential \
pkg-config \
meson \
cmake \
gcovr \
libcmocka-dev \
libglib2.0-dev \
libyaml-dev \
libsystemd-dev \
uuid-dev \
bash-completion \
python3-dev \
libyaml-dev \
meson \
network-manager \
pandoc \
pkg-config \
pycodestyle \
pyflakes3 \
python3-cffi \
python3-coverage \
python3-dev \
python3-pytest \
python3-pytest-cov \
pyflakes3 \
pycodestyle \
libcmocka-dev \
gcovr \
pandoc
python3-yaml \
systemd \
udev \
uuid-dev \
```

# Build using Meson
Expand Down
Loading