add additional tests

This commit is contained in:
Lance Vick 2023-11-15 02:24:13 -08:00
parent 1f44df6c32
commit ac45dfd758
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
12 changed files with 54 additions and 0 deletions

16
tests/c/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM ocirep/busybox as build
COPY --from=ocirep/gcc . /
COPY --from=ocirep/musl . /
COPY --from=ocirep/binutils . /
COPY . .
RUN set -eux; \
gcc main.c -static -o main; \
mkdir -p $HOME/rootfs/etc; \
echo "nogroup:*:100:nobody" > ~/rootfs/etc/group; \
echo "nobody:*:100:100:::" > ~/rootfs/etc/passwd; \
cp main $HOME/rootfs/
FROM scratch
COPY --from=build --chown=100:100 /home/user/rootfs /
USER 100:100
ENTRYPOINT ["/main"]

5
tests/c/main.c Normal file
View File

@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
printf("Success\n");
return 0;
}

14
tests/perl/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM ocirep/busybox as build
COPY . .
RUN set -eux; \
mkdir -p $HOME/rootfs/etc; \
echo "nogroup:*:100:nobody" > ~/rootfs/etc/group; \
echo "nobody:*:100:100:::" > ~/rootfs/etc/passwd; \
cp main.py $HOME/rootfs/
FROM scratch
COPY --from=build --chown=100:100 /home/user/rootfs /
COPY --from=ocirep/perl . /
USER 100:100
ENTRYPOINT ["/usr/bin/perl"]
CMD ["/main.pl"]

4
tests/perl/main.pl Normal file
View File

@ -0,0 +1,4 @@
use strict;
use warnings;
print("Success\n");

14
tests/python/Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM ocirep/busybox as build
COPY . .
RUN set -eux; \
mkdir -p $HOME/rootfs/etc; \
echo "nogroup:*:100:nobody" > ~/rootfs/etc/group; \
echo "nobody:*:100:100:::" > ~/rootfs/etc/passwd; \
cp main.py $HOME/rootfs/
FROM scratch
COPY --from=build --chown=100:100 /home/user/rootfs /
COPY --from=ocirep/python . /
USER 100:100
ENTRYPOINT ["/usr/bin/python"]
CMD ["/main.py"]

1
tests/python/main.py Normal file
View File

@ -0,0 +1 @@
print("Success")