Skip to content

Commit 1cfccbf

Browse files
committedJan 12, 2025·
docker: add ubuntu24-ci docker image support
Signed-off-by: Christian Hopps <[email protected]>
1 parent 901d059 commit 1cfccbf

File tree

3 files changed

+70
-4
lines changed

3 files changed

+70
-4
lines changed
 

‎docker/ubuntu-ci/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ ARG UBUNTU_VERSION=22.04
22
FROM ubuntu:$UBUNTU_VERSION
33

44
ARG DEBIAN_FRONTEND=noninteractive
5-
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
65

76
# Update and install build requirements.
87
RUN apt update && apt upgrade -y && \
@@ -77,14 +76,15 @@ RUN apt update && apt upgrade -y && \
7776
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/iana/IANA-IPPM-METRICS-REGISTRY-MIB -O /usr/share/snmp/mibs/iana/IANA-IPPM-METRICS-REGISTRY-MIB && \
7877
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/SNMPv2-PDU -O /usr/share/snmp/mibs/ietf/SNMPv2-PDU && \
7978
wget https://raw.githubusercontent.com/FRRouting/frr-mibs/main/ietf/IPATM-IPMC-MIB -O /usr/share/snmp/mibs/ietf/IPATM-IPMC-MIB && \
79+
rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED && \
8080
python3 -m pip install wheel && \
81-
python3 -m pip install 'protobuf<4' grpcio grpcio-tools && \
81+
python3 -m pip install protobuf grpcio grpcio-tools && \
8282
python3 -m pip install 'pytest>=6.2.4' 'pytest-xdist>=2.3.0' && \
8383
python3 -m pip install 'scapy>=2.4.5' && \
8484
python3 -m pip install xmltodict && \
8585
python3 -m pip install git+https://github.com/Exa-Networks/exabgp@0659057837cd6c6351579e9f0fa47e9fb7de7311
8686

87-
ARG UID=1000
87+
ARG UID=1010
8888
RUN groupadd -r -g 92 frr && \
8989
groupadd -r -g 85 frrvty && \
9090
adduser --system --ingroup frr --home /home/frr \

‎docker/ubuntu22-ci/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This builds an ubuntu 22.04 container for dev / test
55
# Build
66

77
```
8-
docker build -t frr-ubuntu22:latest -f docker/ubuntu-ci/Dockerfile .
8+
docker build -t frr-ubuntu22:latest --build-arg=UBUNTU_VERSION=22.04 -f docker/ubuntu-ci/Dockerfile .
99
```
1010

1111
# Run

‎docker/ubuntu24-ci/README.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Ubuntu 24.04
2+
3+
This builds an ubuntu 24.04 container for dev / test
4+
5+
# Build
6+
7+
```
8+
docker build -t frr-ubuntu24:latest --build-arg=UBUNTU_VERSION=24.04 -f docker/ubuntu-ci/Dockerfile .
9+
```
10+
11+
# Run
12+
13+
```
14+
docker run -d --init --privileged --name frr-ubuntu24 --mount type=bind,source=/lib/modules,target=/lib/modules frr-ubuntu24:latest
15+
```
16+
17+
# Running full topotest (container stops at end)
18+
19+
```
20+
docker run --init -it --privileged --name frr-ubuntu24 \
21+
-v /lib/modules:/lib/modules frr-ubuntu24:latest \
22+
bash -c 'cd /home/frr/frr/tests/topotests; sudo pytest -nauto --dist=loadfile'
23+
```
24+
25+
# Extract results from the above run into `run-results` dir and analyze
26+
27+
```
28+
tests/topotests/analyze.py -C frr-ubuntu24 -Ar run-results
29+
```
30+
31+
# Extract coverage from a stopped container into host FRR source tree
32+
33+
```
34+
docker export frr-ubuntu24 | tar --strip=3 --wildcards -vx '*.gc??'
35+
lcov -b $(pwd) --capture --directory . --output-file=coverage.info
36+
```
37+
38+
# make check
39+
40+
```
41+
docker exec frr-ubuntu24 bash -c 'cd ~/frr ; make check'
42+
```
43+
44+
# interactive bash
45+
46+
```
47+
docker exec -it frr-ubuntu24 bash
48+
```
49+
50+
# Run a specific topotest
51+
52+
```
53+
docker exec frr-ubuntu24 bash -c 'cd ~/frr/tests/topotests ; sudo pytest ospf_topo1/test_ospf_topo1.py'
54+
```
55+
56+
# stop & remove container
57+
58+
```
59+
docker stop frr-ubuntu24 ; docker rm frr-ubuntu24
60+
```
61+
62+
# remove image
63+
64+
```
65+
docker rmi frr-ubuntu24:latest
66+
```

0 commit comments

Comments
 (0)
Please sign in to comment.