Support running on Mac or Windows via Docker

This commit is contained in:
Sébastien Deleuze
2023-07-14 10:37:25 +02:00
parent b449460ada
commit 0b975ae905
3 changed files with 21 additions and 1 deletions

View File

@@ -11,11 +11,17 @@ The `appTest` task tests the application running on the JVM. The `checkpointRest
== Prerequisites
=== Linux
- CRaC enabled JDK such as https://www.azul.com/downloads/?package=jdk-crac#zulu[the one provided by Azul].
- Linux
> NOTE: If using SDKMan then run `sdk env install`.
=== Mac Intel or Windows
- Docker
- Use `./run-dev-container.sh` before running Gradle commands
== Contributing
Please read and follow the link:CONTRIBUTING.adoc[contributing guide].

View File

@@ -7,6 +7,8 @@ RUN ./setup.sh
ENV JAVA_HOME /opt/crac-jdk
ENV PATH $JAVA_HOME/bin:/opt/ytt/bin:/opt/docker-compose/bin:$PATH
ENV GRADLE_OPTS -Dorg.gradle.project.buildDir=/tmp/gradle-build
RUN git config --global --add safe.directory /workspace
ADD docker-lib.sh /docker-lib.sh
ENTRYPOINT [ "switch", "shell=/bin/bash", "--", "codep", "/bin/docker daemon" ]

12
run-dev-container.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
REBUILD=false
HOST_WORK_DIR="$( pwd )"
CONTAINER_WORK_DIR=/workspace
docker image ls | grep spring-checkpoint-restore-smoke-tests-dev | grep ${CONTAINER_TAG} >/dev/null 2>&1 || export REBUILD=true
test "$REBUILD" = false || docker build \
-t spring-checkpoint-restore-smoke-tests-dev -f $HOST_WORK_DIR/ci/images/ci-image/Dockerfile $HOST_WORK_DIR/ci/images
docker run -it --entrypoint /bin/bash --privileged -v $HOST_WORK_DIR:$CONTAINER_WORK_DIR:delegated -w $CONTAINER_WORK_DIR spring-checkpoint-restore-smoke-tests-dev