diff --git a/tests/c/Dockerfile b/tests/c/Dockerfile new file mode 100644 index 0000000..99b8c45 --- /dev/null +++ b/tests/c/Dockerfile @@ -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"] diff --git a/tests/c/main.c b/tests/c/main.c new file mode 100644 index 0000000..b906db4 --- /dev/null +++ b/tests/c/main.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Success\n"); + return 0; +} diff --git a/examples/go_hello/Dockerfile b/tests/go/Dockerfile similarity index 100% rename from examples/go_hello/Dockerfile rename to tests/go/Dockerfile diff --git a/examples/go_hello/main.go b/tests/go/main.go similarity index 100% rename from examples/go_hello/main.go rename to tests/go/main.go diff --git a/tests/perl/Dockerfile b/tests/perl/Dockerfile new file mode 100644 index 0000000..188953f --- /dev/null +++ b/tests/perl/Dockerfile @@ -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"] diff --git a/tests/perl/main.pl b/tests/perl/main.pl new file mode 100644 index 0000000..548467c --- /dev/null +++ b/tests/perl/main.pl @@ -0,0 +1,4 @@ +use strict; +use warnings; + +print("Success\n"); diff --git a/tests/python/Dockerfile b/tests/python/Dockerfile new file mode 100644 index 0000000..8a1612e --- /dev/null +++ b/tests/python/Dockerfile @@ -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"] diff --git a/tests/python/main.py b/tests/python/main.py new file mode 100644 index 0000000..e6d1399 --- /dev/null +++ b/tests/python/main.py @@ -0,0 +1 @@ +print("Success") diff --git a/examples/rust_pcsc_static/Cargo.lock b/tests/rust_pcsc_static/Cargo.lock similarity index 100% rename from examples/rust_pcsc_static/Cargo.lock rename to tests/rust_pcsc_static/Cargo.lock diff --git a/examples/rust_pcsc_static/Cargo.toml b/tests/rust_pcsc_static/Cargo.toml similarity index 100% rename from examples/rust_pcsc_static/Cargo.toml rename to tests/rust_pcsc_static/Cargo.toml diff --git a/examples/rust_pcsc_static/Dockerfile b/tests/rust_pcsc_static/Dockerfile similarity index 100% rename from examples/rust_pcsc_static/Dockerfile rename to tests/rust_pcsc_static/Dockerfile diff --git a/examples/rust_pcsc_static/main.rs b/tests/rust_pcsc_static/main.rs similarity index 100% rename from examples/rust_pcsc_static/main.rs rename to tests/rust_pcsc_static/main.rs