mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Start Ryuk ourselves
This commit is contained in:
parent
2af8e3c21f
commit
49ad9c1d9c
@ -6,8 +6,4 @@ WORKDIR /work
|
||||
# fonts-dejavu is needed for the same RTL rendering as on CI
|
||||
RUN apt-get update && apt-get -y install docker.io fonts-dejavu
|
||||
|
||||
# Disable the ryuk resource reaper, because it doesn't work in environments
|
||||
# that disallow starting privileged containers (such as rootless containers)
|
||||
ENV TESTCONTAINERS_RYUK_DISABLED=true
|
||||
|
||||
ENTRYPOINT ["npx", "playwright", "test", "--update-snapshots", "--reporter", "line"]
|
||||
|
||||
@ -108,4 +108,24 @@ EOF
|
||||
fi
|
||||
done
|
||||
|
||||
# Our Playwright fixtures use Testcontainers [1], which in uses a docker image
|
||||
# called Ryuk [2], which will clean up any dangling containers/networks/etc
|
||||
# after a timeout, if the parent process dies unexpectedly.
|
||||
#
|
||||
# To do this, Ryuk requires access to the docker socket, so Testcontainers
|
||||
# starts the Ryuk container with a bind-mount of `/var/run/docker.sock`.
|
||||
# However, we're going to be running Playwright (and hence Testcontainers)
|
||||
# itself in a container, but talking to the Docker daemon on the *host*, which
|
||||
# means that bind mounts will be relative to the *host* filesystem. In short,
|
||||
# it will try to bind-mount the *host's* `/var/run/docker.sock` rather than
|
||||
# that from inside the element-web-playwright-common container.
|
||||
#
|
||||
# To solve this problem, we start Ryuk ourselves (with the correct docker
|
||||
# socket) rather than waiting for Testcontainers to do so. Testcontainers will
|
||||
# find the running Ryuk instance and connect to it rather than start a new one.
|
||||
#
|
||||
# [1] https://testcontainers.com/
|
||||
# [2] https://github.com/testcontainers/moby-ryuk
|
||||
docker run -d --rm --label org.testcontainers.ryuk=true -v "${docker_sock}":/var/run/docker.sock -p 8080 --name="playwright-ryuk" testcontainers/ryuk:0.14.0
|
||||
|
||||
docker run "${RUN_ARGS[@]}" "$IMAGE_NAME" "${DEFAULT_ARGS[@]}" "$@"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user