Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Mounts directories read-only by default

AuthorDaveJarvis <email>
Date2022-12-11 22:43:19 GMT-0800
Commitf97d7c08a005b05fb8104720051c4445e1b03077
Parent0cca98d
Delta8 lines added, 1 line removed, 7-line increase
container/manage.sh
# ---------------------------------------------------------------------------
utile_build() {
+ # Show what commands are run while building, but not the commands' output.
${CONTAINER_EXE} build \
--network=${CONTAINER_NETWORK} \
--tag ${CONTAINER_NAME} . | \
grep ^STEP
}
+# ---------------------------------------------------------------------------
+# Creates the command-line option for a read-only mountpoint.
+#
+# $1 - The host directory.
+# $2 - The guest (container) directory.
+# ---------------------------------------------------------------------------
get_mountpoint() {
local result=""
if [ ! -z "${1}" ]; then
- result="-v ${1}:${2}:Z"
+ result="-v ${1}:${2}:ro"
fi