Skip to content

Commit

Permalink
fix: volume map to default Docker Deskotp file sharing (/Users)
Browse files Browse the repository at this point in the history
Signed-off-by: Ales Verbic <verbotenj@blinklabs.io>
  • Loading branch information
verbotenj committed May 6, 2024
1 parent ed0c041 commit 4bbb65f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/cardano-cli/files/cardano-cli.sh.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

declare -a valid_paths=(
"/Users"
"/Volumes"
"/private"
"/tmp"
"/var/folders"
)

_args=()

# Remap absolute paths to /host in the container
Expand Down
18 changes: 17 additions & 1 deletion packages/mithril-client/files/mithril-client.sh.gotmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/bin/bash

set -x

declare -a _darwin_allowed_paths=(
"/Users"
"/Volumes"
"/private"
"/tmp"
"/var/folders"
)

# setup options
_options=(${@})
for i in ${!_options[@]}; do
Expand Down Expand Up @@ -36,6 +46,13 @@ if [[ -z ${GENESIS_VERIFICATION_KEY} && -f ${GENESIS_VERIFICATION_KEY_PATH} ]];
fi

_docker_args=()
if [[ $(uname -s) == Darwin ]]; then
for _path in ${_valid_paths}; do
_docker_args+=( "-v" "${_path}:/host${_path}" )
done
else
_docker_args+=( "-v" "/:/host" )
fi

# flatten options into args
for i in ${_options[@]}; do
Expand All @@ -49,7 +66,6 @@ docker run \
-ti \
--rm \
-u $(id -u):$(id -g) \
-v /:/host \
-w /host$(pwd) \
--entrypoint /bin/bash \
-e AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT} \
Expand Down

0 comments on commit 4bbb65f

Please sign in to comment.