Skip to content

Commit fe5a070

Browse files
committed
Add Devcontainer example
Signed-off-by: David-VTUK <david.holder@gmail.com>
1 parent ed35685 commit fe5a070

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

devcontainer-example/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Devcontainer Examples
2+
3+
The following directory includes examples of [Visual Studio Code Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) configurations for developing ebpf applications.
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Go-ebpf-env",
3+
"build": {"dockerfile": "Dockerfile"},
4+
5+
// Configure tool-specific properties.
6+
"customizations": {
7+
// Configure properties specific to VS Code.
8+
"vscode": {
9+
"settings": {},
10+
"extensions": [
11+
"streetsidesoftware.code-spell-checker",
12+
"ms-vscode.cpptools-extension-pack",
13+
"ms-vscode.cpptools",
14+
"nicknickolaev.ebpf-assembly",
15+
"golang.Go"
16+
]
17+
}
18+
},
19+
20+
"runArgs": ["--network=host"],
21+
"privileged": true
22+
}

0 commit comments

Comments
 (0)