Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: unified testimages #1697

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ integration:

alerting:
cd test/integration/alerting && docker build -t securesystemsengineering/alerting-endpoint . && cd -

build-testimage-%:
docker build --build-arg="MESSAGE=$*" -t securesystemsengineering/testimage:$* -f test/testdata/dockerfiles/Dockerfile test/testdata/dockerfiles
21 changes: 18 additions & 3 deletions test/testdata/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
FROM alpine:3.18@sha256:eece025e432126ce23f223450a0326fbebde39cdf496a85d8c016293fc851978
RUN echo "while true; do echo 'Hello World of signing ;)'; sleep 3; done" >> hello.sh
CMD ["sh", "hello.sh"]
FROM gcc@sha256:f993601701a37bef71e7f8fc1ef9410b09b15556f4371b06dcc10202cc81f9ea AS builder

ARG MESSAGE
ENV MESSAGE=$MESSAGE

WORKDIR /

RUN apt update && apt install -y gettext

COPY main.c /main.c
RUN envsubst < /main.c > /main_.c
RUN gcc -o /main -static /main_.c

FROM scratch

COPY --from=builder /main /main

ENTRYPOINT ["./main"]
3 changes: 0 additions & 3 deletions test/testdata/dockerfiles/Dockerfile.unsigned

This file was deleted.

3 changes: 3 additions & 0 deletions test/testdata/dockerfiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test Images

To build a new test image run `make build-testimage-<tag>`, replacing the `<tag>` with a string of your choice. This will create an image called `securesystemsengineering/testimage:<tag>` which can be pushed and used for testing purposes :tada:
12 changes: 0 additions & 12 deletions test/testdata/dockerfiles/double_sig/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions test/testdata/dockerfiles/double_sig/main.c

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <unistd.h>
#include <sys/syscall.h>

const char message[] = "Signed.\n";
const char message[] = "$MESSAGE\n";

int main()
{
Expand Down
12 changes: 0 additions & 12 deletions test/testdata/dockerfiles/signed/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions test/testdata/dockerfiles/special_sig/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions test/testdata/dockerfiles/special_sig/main.c

This file was deleted.

12 changes: 0 additions & 12 deletions test/testdata/dockerfiles/unsigned/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions test/testdata/dockerfiles/unsigned/main.c

This file was deleted.

12 changes: 0 additions & 12 deletions test/testdata/dockerfiles/wrong_signer/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions test/testdata/dockerfiles/wrong_signer/main.c

This file was deleted.

Loading