[LTP] [PATCH] Add simple Containerfile

Marius Kittler mkittler@suse.de
Wed Oct 4 14:28:59 CEST 2023


> The container can be built with a command like:
> 
> podman build -t tumbleweed/ltp \
>        --build-arg PREFIX=registry.opensuse.org/opensuse/ \
>        --build-arg DISTRO_NAME=tumbleweed \
>        --build-arg DISTRO_RELEASE=20230925 .
> 
> Or just
> 
> podman build -t alpine/ltp .
> 
> It contains Kirk in /opt/kirk. So
> 
> cd /opt/kirk && ./kirk -f ltp -r syscalls
> 
> will run some tests.

It would likely make sense to add a section with these information in the 
README as well.

I'm also wondering about the workflow of making changes (e.g. to a single test) 
and then re-compiling and re-running the specific test. Maybe that's also worth 
considering/documenting.

> 
> Note a much smaller container can be found at:
> https://registry.opensuse.org/cgi-bin/cooverview?srch_term=project%3D%5Ebenc
> hmark+container%3D.* This is created with SUSE's build system which does not
> use container files
> 
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> Cc: Petr Vorel <pvorel@suse.cz>
> Cc: Marius Kittler <mkittler@suse.de>
> ---
> 
> RFC comments:
>     * Add git clean -fdX which should remove any build artifacts
>       this is different from the suggestion of just doing a check. I just
>       found it easier to remove the build files.

Where we document the usage of the container we should also document that 
it'll do this kind of cleanup so there are no surprises.

>     * Added seperate alpine and tumbleweed runtime scripts. Again it's
>       different from the suggestion just because it's easier to add
>       seperate scripts than adding a switch
>     * Obviously a number of distros are missing runtime scripts. They can
>       be added when someone is motivated to do so.
> 
…
> +RUN mkdir /build
> +WORKDIR /build
> +COPY . /build
> +RUN ./ci/${DISTRO_NAME}.sh
> +RUN git clean -fdX
> +RUN ./build.sh -p $LTPROOT -i
> +

It might make sense to combine consecutive run commands (see
https://github.com/hadolint/hadolint/wiki/DL3059).





More information about the ltp mailing list