diff --git a/Makefile b/Makefile index d5ca96dd..422ea9d4 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ docker-clean: _NO_SYNC_KALEIDOSCOPE=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "rm -rf -- testing/googletest/build/* _build/* /kaleidoscope-persist/temp/*" docker-bash: - ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash" + _NO_SYNC_KALEIDOSCOPE=1 DOCKER_LIVE_KALEIDOSCOPE_DIR=1 ARDUINO_DIRECTORIES_USER="$(ARDUINO_DIRECTORIES_USER)" ./bin/run-docker "bash" run-tests: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/virtual/boards.txt build-gtest-gmock $(MAKE) -c tests diff --git a/bin/run-docker b/bin/run-docker index aac051e0..db346dba 100755 --- a/bin/run-docker +++ b/bin/run-docker @@ -50,13 +50,20 @@ tar -cf "${XFER_DIR}/kaleidoscope.tar" \ fi +if [ -z "$DOCKER_LIVE_KALEIDOSCOPE_DIR" ]; then + _KALEIDOSCOPE_MOUNT="type=tmpfs,destination=/kaleidoscope:exec" +else + echo "Kaleidoscope is mounted read/write inside docker" + _KALEIDOSCOPE_MOUNT="type=bind,source=$(pwd),destination=/kaleidoscope,consistency=cached" +fi + -echo "Building the docker image..." +echo "Building the docker image. This could take a few minutes." docker build -q -t kaleidoscope/docker etc # We do want word splitting since there are multiple options here # shellcheck disable=SC2086 docker run --rm $DOCKER_RUN_INTERACTIVE_OPTS \ - --mount type=tmpfs,destination=/kaleidoscope:exec \ + --mount ${_KALEIDOSCOPE_MOUNT} \ --mount type=bind,source="${XFER_DIR}",destination=/kaleidoscope-src,consistency=delegated,readonly \ --mount type=volume,source=kaleidoscope-persist,destination=/kaleidoscope-persist,consistency=delegated \ --mount type=volume,source=kaleidoscope-googletest-build,destination=/kaleidoscope/testing/googletest/build,consistency=delegated \