Skip to content

Commit 829e50c

Browse files
committed
Add devcontainer examples
Signed-off-by: David-VTUK <[email protected]>
1 parent 28d837e commit 829e50c

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

devcontainer-examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Devcontainer Examples
2+
3+
This directory contains example .devcontainer configurations that allow developers to quickly set up a consistent eBPF development environment in Visual Studio Code. Further details can be found [here](https://code.visualstudio.com/docs/devcontainers/containers)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM mcr.microsoft.com/devcontainers/go:1.23-bookworm
2+
3+
RUN apt update
4+
5+
RUN apt install -y build-essential
6+
RUN apt install -y pkg-config
7+
RUN apt install -y clang
8+
RUN apt install -y llvm
9+
RUN apt install -y git
10+
RUN apt install -y libelf-dev
11+
RUN apt install -y libpcap-dev
12+
RUN apt install -y iproute2
13+
RUN apt install -y iputils-ping
14+
RUN apt install -y linux-headers-generic
15+
RUN apt install -y libbpf-dev
16+
RUN apt install -y linux-libc-dev
17+
RUN apt install -y cmake
18+
RUN apt install -y libpcap-dev
19+
RUN apt install -y libcap-ng-dev
20+
RUN apt install -y libbfd-dev
21+
RUN apt install -y gcc-multilib
22+
RUN apt install -y m4
23+
RUN ln -sf /usr/include/asm-generic/ /usr/include/asm
24+
RUN apt install -y libcap-dev
25+
RUN ln -sf /usr/local/go/bin/go /bin/go
26+
RUN ln -sf /usr/include/asm-generic/ /usr/include/asm
27+
28+
RUN mkdir /sources/
29+
WORKDIR /sources/
30+
RUN git clone --recurse-submodules https://github.com/libbpf/bpftool.git
31+
RUN make -C bpftool/src/ install
32+
RUN git clone --recurse-submodules https://github.com/xdp-project/xdp-tools.git
33+
RUN make -C xdp-tools/ install
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# eBPF and Go
2+
3+
This example uses `mcr.microsoft.com/devcontainers/go:1.23-bookworm` as a base image and adds on all the dependencies required for eBPF development, such as `clang`, `llvm`, `linux-headers`, etc.
4+
5+
This is suitable for developing eBPF applications with a `Go` based User Space component.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "Go-ebpf-env",
3+
"build": {"dockerfile": "Dockerfile"},
4+
"customizations": {
5+
"vscode": {
6+
"settings": {},
7+
"extensions": [
8+
"streetsidesoftware.code-spell-checker",
9+
"ms-vscode.cpptools-extension-pack",
10+
"ms-vscode.cpptools",
11+
"nicknickolaev.ebpf-assembly",
12+
"golang.Go"
13+
]
14+
}
15+
},
16+
"runArgs": ["--network=host"],
17+
"privileged": true
18+
}

0 commit comments

Comments
 (0)