File tree Expand file tree Collapse file tree 6 files changed +51
-0
lines changed
Expand file tree Collapse file tree 6 files changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ permissions:
1111env :
1212 PLATFORMS : linux/amd64,linux/arm64
1313 BUILD_DIRS : |
14+ tutorials/test/
1415 tutorials/net/mtu/
1516
1617jobs :
Original file line number Diff line number Diff line change 1+ =================================================
2+ 🐧 bitpuff.io tutorial setup test 🐧
3+ =================================================
4+ This container tests that your docker setup is
5+ correct, and that privileged containers can
6+ create Linux network namespaces (NSs).
7+ -------------------------------------------------
Original file line number Diff line number Diff line change 1+ ## Test setup container
2+
3+ This container image tests that your docker setup is correct, and that privileged
4+ containers can create [ Linux Network namespaces] ( https://man7.org/linux/man-pages/man7/network_namespaces.7.html ) .
5+
6+ ## How to use it
7+
8+ ```
9+ docker run --privileged ghcr.io/bitpuff-io/tutorials.test
10+ ```
Original file line number Diff line number Diff line change 1+ FROM debian:latest
2+
3+ LABEL maintainer=
"Marc Sune <[email protected] >" 4+ LABEL version="latest"
5+ LABEL description="bitpuff.io MTU setup test"
6+ LABEL org.opencontainers.image.authors=
"Marc Sune <[email protected] >" 7+ LABEL org.opencontainers.image.url="https://github.com/bitpuff-io/code/"
8+ LABEL org.opencontainers.image.documentation="https://bitpuff.io/tutorials/setup/"
9+ LABEL org.opencontainers.image.source="https://github.com/bitpuff-io/code/"
10+ LABEL org.opencontainers.image.licenses="BSD"
11+
12+ RUN apt update && apt install -y --no-install-recommends \
13+ iproute2 \
14+ && rm -rf /var/lib/apt/lists/*
15+
16+ RUN mkdir /bp
17+ COPY . /bp
18+ WORKDIR /root
19+ CMD ["/bp/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ tutorials.test
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ cat /bp/BANNER
6+
7+ echo " [INFO] Creating namespace 'bp_test_ns'..."
8+ ip netns add bp_test_ns
9+
10+ echo " [INFO] Executing command inside the NS..."
11+ ip netns exec bp_test_ns echo " Hello world!"
12+
13+ echo " [INFO] All is good!"
You can’t perform that action at this time.
0 commit comments