@@ -333,3 +333,129 @@ For testing purposes a x86_64 static build from the current HEAD and is
333333available here:
334334
335335https://monom.org/linux-nvme/upload/nvme-cli-latest-x86_64
336+
337+ ## Container-Based Debugging and CI Build Reproduction
338+
339+ The nvme-cli project provides prebuilt CI containers that allow you to locally
340+ reproduce GitHub Actions builds for debugging and development. These containers
341+ mirror the environments used in the official CI workflows.
342+
343+ CI Containers Repository:
344+ https://github.com/linux-nvme/ci-containers
345+
346+ CI Build Workflow Reference:
347+ https://github.com/linux-nvme/nvme-cli/blob/master/.github/workflows/libnvme-build.yml
348+
349+ ### 1. Pull a CI Container
350+
351+ All CI containers are published as OCI/Docker images.
352+
353+ Example: Ubuntu latest CI image:
354+
355+ ``` bash
356+ docker pull ghcr.io/linux-nvme/debian.python:latest
357+ ```
358+
359+ Or with Podman:
360+
361+ ``` bash
362+ podman pull ghcr.io/linux-nvme/debian.python:latest
363+ ```
364+
365+ ### 2. Start the Container and Log In
366+
367+ Start an interactive shell inside the container:
368+
369+ ``` bash
370+ docker run --rm -it \
371+ --name nvme-cli-debug \
372+ ghcr.io/linux-nvme/debian.python:latest \
373+ bash
374+ ```
375+
376+ Or with Podman:
377+
378+ ``` bash
379+ podman run --rm -it \
380+ --name nvme-cli-debug \
381+ ghcr.io/linux-nvme/debian.python:latest \
382+ bash
383+ ```
384+
385+ You are now logged into the same environment used by CI.
386+
387+ ### 3. Clone the nvme-cli Repository
388+
389+ Inside the running container:
390+
391+ ``` bash
392+ git clone https://github.com/linux-nvme/nvme-cli.git
393+ cd nvme-cli
394+ ```
395+
396+ (Optional) Checkout a specific branch or pull request:
397+
398+ ``` bash
399+ git checkout < branch-or-commit>
400+ ```
401+
402+ ### 4. Run the CI Build Script
403+
404+ The GitHub Actions workflow uses ` scripts/build.sh ` . To reproduce the CI build locally:
405+
406+ ``` bash
407+ ./scripts/build.sh
408+ ```
409+
410+ Build artifacts remain inside the container unless a host volume is mounted.
411+
412+ ### 5. Cross-Build Example
413+
414+ The CI supports cross compilation using a dedicated cross-build container.
415+
416+ #### 5.1 Pull the Cross-Build Container
417+
418+ ``` bash
419+ docker pull ghcr.io/linux-nvme/ubuntu-cross-s390x:latest
420+ ```
421+
422+ Or with Podman:
423+
424+ ``` bash
425+ podman pull ghcr.io/linux-nvme/ubuntu-cross-s390x:latest
426+ ```
427+
428+ #### 5.2 Start the Cross-Build Container
429+
430+ ``` bash
431+ docker run --rm -it \
432+ --name nvme-cli-cross \
433+ ghcr.io/linux-nvme/ubuntu-cross-s390x:latest \
434+ bash
435+ ```
436+
437+ Or with Podman:
438+
439+ ``` bash
440+ podman run --rm -it \
441+ --name nvme-cli-cross \
442+ ghcr.io/linux-nvme/ubuntu-cross-s390x:latest \
443+ bash
444+ ```
445+
446+ #### 5.3 Clone the Repository
447+
448+ ``` bash
449+ git clone https://github.com/linux-nvme/nvme-cli.git
450+ cd nvme-cli
451+ ```
452+
453+ #### 5.4 Run a Cross Build
454+
455+ Example: Cross-build for ` s390x ` :
456+
457+ ``` bash
458+ ./scripts/build.sh -b release -c gcc -t s390x cross
459+ ```
460+
461+ The exact supported targets depend on the toolchains installed in the container.
0 commit comments