public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH] Add simple Alpine container
@ 2023-09-26  9:01 Richard Palethorpe via ltp
  2023-09-26 10:51 ` Marius Kittler
  2023-09-27  6:27 ` Petr Vorel
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Palethorpe via ltp @ 2023-09-26  9:01 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

Can be built with `docker/podman build .`. Then run with `podman -it
run sh`. It contains Kirk in /opt/kirk. So `cd /opt/kirk && ./kirk -f
ltp --run-suite syscalls` will run some tests.
---

Hello,

This builds and installs the LTP and Kirk inside an Alpine
container. The idea is to use a standard container workflow to build
and run the LTP from source. This helps with testing LTP itself and
running tests inside a container.

I'd like to add some container files to upstream to help with various
workflows.

The container has a number of problems:

1. If the Git directory has build artifacts in it, these are copied
   into the container (.dockerignore may help)
2. The resulting container is quite large (possibly due to debug symbols)
3. Where should we put container files and how should we name them?
4. Making the slightest change results in a complete container rebuild

Note that SUSE publishes a TW container based on our packaging system:
https://build.opensuse.org/project/show/benchmark:ltp:devel
https://registry.opensuse.org/cgi-bin/cooverview?srch_term=project%3D%5Ebenchmark+container%3D.*

Also, for developing tests, it may be better to build the LTP outside
of a container then copy in the files.

Latest tree is here:
https://github.com/richiejp/ltp/tree/alpine-container

 Containerfile | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Containerfile

diff --git a/Containerfile b/Containerfile
new file mode 100644
index 000000000..7bd50ce52
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,35 @@
+FROM alpine:3.18 AS build
+ARG LTPROOT=/opt/ltp
+
+RUN mkdir /build
+WORKDIR /build
+COPY . /build
+RUN ./ci/alpine.sh
+RUN ./build.sh -p $LTPROOT -i
+
+FROM alpine:3.18
+ARG LTPROOT=/opt/ltp
+ARG KIRKROOT=/opt/kirk
+
+RUN apk add \
+            acl \
+            keyutils \
+            libaio \
+            libacl \
+            libcap \
+            libselinux \
+            libsepol \
+            libtirpc \
+            numactl \
+            openssl \
+            py3-msgpack
+
+COPY --from=build $LTPROOT $LTPROOT
+ENV LTPROOT=$LTPROOT
+ENV PATH=$LTPROOT/testcases/bin:$LTPROOT/bin:$PATH
+
+RUN mkdir -p $KIRKROOT
+COPY --from=build /build/tools/kirk $KIRKROOT
+
+RUN adduser -D -g "Unprivileged LTP user" ltp
+RUN su ltp
-- 
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-27  9:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26  9:01 [LTP] [RFC PATCH] Add simple Alpine container Richard Palethorpe via ltp
2023-09-26 10:51 ` Marius Kittler
2023-09-27  7:00   ` Richard Palethorpe
2023-09-27  6:27 ` Petr Vorel
2023-09-27  7:29   ` Richard Palethorpe
2023-09-27  9:05     ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox