File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ declare -a valid_paths=(
4
+ " /Users"
5
+ " /Volumes"
6
+ " /private"
7
+ " /tmp"
8
+ " /var/folders"
9
+ )
10
+
3
11
_args=()
4
12
5
13
# Remap absolute paths to /host in the container
26
34
_docker_args+=( " -v" " {{ .Paths.ContextDir }}/node-ipc:/ipc" )
27
35
fi
28
36
37
+ if [[ $( uname -s) == Darwin ]]; then
38
+ for _path in " ${_darwin_allowed_paths[@]} " ; do
39
+ _docker_args+=( " -v" " ${_path} :/host${_path} " )
40
+ done
41
+ else
42
+ _docker_args+=( " -v" " /:/host" )
43
+ fi
44
+
29
45
# Run cardano-cli via Docker
30
46
# We map the host filesystem and node socket into the container
31
47
docker run \
32
48
-ti \
33
49
--rm \
34
50
-u $( id -u) :$( id -g) \
35
- -v /:/host \
36
51
-w /host$( pwd) \
37
52
-e CARDANO_NODE_SOCKET_PATH=/ipc/node.socket \
38
53
" ${_docker_args[@]} " \
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ declare -a _darwin_allowed_paths=(
4
+ " /Users"
5
+ " /Volumes"
6
+ " /private"
7
+ " /tmp"
8
+ " /var/folders"
9
+ )
10
+
3
11
# setup options
4
12
_options=(${@ } )
5
13
for i in ${! _options[@]} ; do
@@ -36,6 +44,13 @@ if [[ -z ${GENESIS_VERIFICATION_KEY} && -f ${GENESIS_VERIFICATION_KEY_PATH} ]];
36
44
fi
37
45
38
46
_docker_args=()
47
+ if [[ $( uname -s) == Darwin ]]; then
48
+ for _path in " ${_darwin_allowed_paths[@]} " ; do
49
+ _docker_args+=( " -v" " ${_path} :/host${_path} " )
50
+ done
51
+ else
52
+ _docker_args+=( " -v" " /:/host" )
53
+ fi
39
54
40
55
# flatten options into args
41
56
for i in ${_options[@]} ; do
@@ -49,11 +64,10 @@ docker run \
49
64
-ti \
50
65
--rm \
51
66
-u $( id -u) :$( id -g) \
52
- -v /:/host \
53
67
-w /host$( pwd) \
54
68
--entrypoint /bin/bash \
55
- -e AGGREGATOR_ENDPOINT=${AGGREGATOR_ENDPOINT} \
56
- -e GENESIS_VERIFICATION_KEY=${GENESIS_VERIFICATION_KEY} \
69
+ -e AGGREGATOR_ENDPOINT=" ${AGGREGATOR_ENDPOINT} " \
70
+ -e GENESIS_VERIFICATION_KEY=" ${GENESIS_VERIFICATION_KEY} " \
57
71
" ${_docker_args[@]} " \
58
72
ghcr.io/blinklabs-io/mithril-client:{{ .Package.Version }} \
59
73
-c " GENESIS_VERIFICATION_KEY=\$ {GENESIS_VERIFICATION_KEY:-\$ (</opt/cardano/config/{{ .Context.Network }}/genesis.vkey)} /bin/mithril-client ${_args} "
You can’t perform that action at this time.
0 commit comments