Wait for healthy containers in integration test

Rather than waiting 5 seconds and hoping for the best after we boot
docker compose, add docker healthchecks and wait for all the containers
to be healthy.
This commit is contained in:
Donal McBreen
2023-04-25 15:32:48 +01:00
parent 9ec3895dab
commit 52ca5b846a
9 changed files with 61 additions and 17 deletions

View File

@@ -8,7 +8,10 @@ RUN mkdir ssh && \
ssh-keygen -t rsa -f ssh/id_rsa -N ""
COPY registry-dns.conf .
COPY boot.sh .
RUN mkdir certs && openssl req -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key -x509 -days 365 -out certs/domain.crt -subj '/CN=registry' -extensions EXT -config registry-dns.conf
CMD ["bash", "-c", "cp -r * /shared"]
HEALTHCHECK --interval=1s CMD pgrep sleep
CMD ["./boot.sh"]

View File

@@ -0,0 +1,7 @@
#!/bin/bash
cp -r * /shared
trap "pkill -f sleep" term
sleep infinity & wait