Feat: lab0 done

This commit is contained in:
2026-03-10 08:59:36 +08:00
commit 6bfe83ca00
6 changed files with 60 additions and 0 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM docker.io/library/ubuntu:24.04
ENV container=docker \
DEBIAN_FRONTEND=noninteractive
COPY ./root /
RUN apt-get update && \
apt-get install -y --no-install-recommends \
sudo systemd findutils \
iproute2 iputils-ping wireguard wireguard-tools \
openssh-server #&& \
# apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# as the spec says
RUN find /etc/systemd/system /lib/systemd/system \
-path '*.wants/*' \
-not -name '*journald*' \
-not -name '*systemd-tmpfiles*' \
-not -name '*systemd-user-sessions*' \
-print0 | xargs -0 rm -vf
RUN systemctl enable \
wg-quick@wg0.service \
ssh.socket
RUN useradd -m judge -s /bin/bash
VOLUME ["/sys/fs/cgroup"]
ENTRYPOINT ["/lib/systemd/systemd"]
CMD []

8
docker-compose.yaml Normal file
View File

@@ -0,0 +1,8 @@
---
services:
run:
build:
context: .
cap_add:
- NET_ADMIN
- NET_RAW

1
root/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
etc/wireguard/wg0.conf

View File

@@ -0,0 +1,11 @@
Types: deb
URIs: http://ubuntu.cs.nycu.edu.tw/ubuntu/
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://ubuntu.cs.nycu.edu.tw/ubuntu/
Suites: noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

View File

@@ -0,0 +1,8 @@
[Interface]
Address = 192.168.0.17/28
PrivateKey =
[Peer]
PublicKey =
PresharedKey =
AllowedIPs = 192.168.0.0/16
Endpoint = 140.113.17.2:5000

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILti+rM2UdvYTUgBKihp0b/9o2W+KvJVmA2ex0/u8pCV judge@sa-2025