-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile.devcontainer
52 lines (42 loc) · 2.02 KB
/
Dockerfile.devcontainer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM ubuntu:latest
# Avoid prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Add amd64 architecture
RUN dpkg --add-architecture amd64
# Set up repositories for both arm64 and amd64
RUN echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse\n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse\n\
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse\n\
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse\n\
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse\n\
deb [arch=amd64] http://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse" > /etc/apt/sources.list
RUN rm /etc/apt/sources.list.d/ubuntu.sources
# Packages required for cilium/ebpf development
ENV EBPF_PACKAGES="golang-go llvm clang libbpf-dev"
# Update and install essential build tools and kernel headers
RUN apt-get update && apt-get install -y \
build-essential \
crossbuild-essential-amd64 \
linux-headers-6.8.0-52-generic:amd64 \
linux-image-6.8.0-52-generic:amd64 \
git \
vim \
curl \
kmod \
${EBPF_PACKAGES} \
&& rm -rf /var/lib/apt/lists/*
# For Go development
RUN go install -v golang.org/x/tools/gopls@latest
# Create architecture-specific symlink for asm
RUN arch=$(uname -m) && \
case ${arch} in \
aarch64) ln -sf /usr/include/aarch64-linux-gnu/asm /usr/include/asm ;; \
x86_64) ln -sf /usr/include/x86_64-linux-gnu/asm /usr/include/asm ;; \
*) echo "Unsupported architecture: ${arch}" && exit 1 ;; \
esac
# Set the working directory
WORKDIR /workspace
# Keep container running
CMD ["sleep", "infinity"]