Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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"
}
39 changes: 18 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,32 +39,29 @@ 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/).

# Build dependencies
# 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
## Using the Dev Container

### With VS Code

Install the required build and test dependencies (Ubuntu/Debian):
1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. Open the workspace in a container: Open the Command Palette and run "Dev Containers: Reopen in Container"
3. The container automatically installs all dependencies and configures the `ubuntu` user

### Manual Docker Build

```sh
sudo apt install \
build-essential \
pkg-config \
meson \
libglib2.0-dev \
libyaml-dev \
libsystemd-dev \
uuid-dev \
bash-completion \
python3-dev \
python3-cffi \
python3-coverage \
python3-pytest \
python3-pytest-cov \
pyflakes3 \
pycodestyle \
libcmocka-dev \
gcovr \
pandoc
$ docker build -t netplan-dev -f .devcontainer/Dockerfile .
$ docker run -it --rm -v $(pwd):/workspace --name netplan-dev netplan-dev bash
Comment thread
Tony-WLB marked this conversation as resolved.
Outdated
```

# Build dependencies

For a manual setup without containers, install the required build and test dependencies. The full list of dependencies is defined in [`.devcontainer/Dockerfile`](.devcontainer/Dockerfile#L6) under the `# netplan dependencies` section.

# Build using Meson

A Makefile wrapper is also provided for simplified usage. For that approach, please refer to the [Build using Makefile](#build-using-makefile) section below.
Expand Down
Loading