@@ -91,31 +91,31 @@ def _run_nested(fqdn_image, environment, command, interactive, name, net, volume
91
91
def handle_volumes_bind_mount (docker_cmd , homedir , volumes , workspace ):
92
92
volumes = volumes or []
93
93
volumes .extend (['%(homedir)s/.netrc:%(homedir)s/.netrc:ro' % dict (homedir = homedir ),
94
- '%(homedir)s/.gitconfig:%(homedir)s/.gitconfig:ro' % dict (homedir = homedir )])
94
+ '%(homedir)s/.gitconfig:%(homedir)s/.gitconfig:ro' % dict (homedir = homedir ),
95
+ '%(homedir)s/.docker/config.json:%(homedir)s/.docker/config.json:ro' % dict (homedir = homedir )])
95
96
96
- # required for docker login
97
- if os .path .exists ('%(homedir)s/.docker/config.json' % dict (homedir = homedir )):
98
- volumes .append ('%(homedir)s/.docker/config.json:%(homedir)s/.docker/config.json:ro' % dict (homedir = homedir ))
97
+ # required for docker login (certificates)
99
98
if os .path .exists ('/etc/docker' ):
100
99
volumes .append ('/etc/docker:/etc/docker:ro' )
101
100
102
- # Will fail on Mac
103
- if os .path .exists ('/var/lib/osmosis' ):
104
- volumes .append ('/var/lib/osmosis:/var/lib/osmosis:rw' )
105
-
106
101
if utils .get_runtime_command () == utils .PODMAN :
107
102
volumes .extend ([
108
103
'%(workspace)s:%(workspace)s:rw,shared' % dict (workspace = workspace ),
109
104
'%s:/opt/skipper/skipper-entrypoint.sh:rw' % utils .get_extra_file ("skipper-entrypoint.sh" ),
110
105
])
111
106
if os .path .exists ('/var/run/docker.sock' ):
112
107
volumes .append ('/var/run/docker.sock:/var/run/docker.sock:rw' )
108
+ if os .path .exists ('/var/lib/osmosis' ):
109
+ volumes .append ('/var/lib/osmosis:/var/lib/osmosis:rw' )
113
110
else :
114
111
volumes .extend ([
115
112
'%(workspace)s:%(workspace)s:rw,Z' % dict (workspace = workspace ),
116
113
'/var/run/docker.sock:/var/run/docker.sock:Z' ,
117
114
'%s:/opt/skipper/skipper-entrypoint.sh:Z' % utils .get_extra_file ("skipper-entrypoint.sh" ),
118
115
])
116
+ # Will fail on Mac
117
+ if os .path .exists ('/var/lib/osmosis' ):
118
+ volumes .append ('/var/lib/osmosis:/var/lib/osmosis:rw,Z' )
119
119
120
120
for volume in volumes :
121
121
if ":" not in volume :
@@ -144,9 +144,9 @@ def create_vol_localpath_if_needed(volume):
144
144
# that's why we create it as file
145
145
# 2. .docker/config.json - if it is required and doesn't exists we want to create is as file with {} as data
146
146
if ".gitconfig" in host_path and not os .path .exists (host_path ):
147
- utils .create_path_and_add_data (host_path , data = "" , is_file = True )
147
+ utils .create_path_and_add_data (full_path = host_path , data = "" , is_file = True )
148
148
elif "docker/config.json" in host_path and not os .path .exists (host_path ):
149
- utils .create_path_and_add_data (host_path , data = "{}" , is_file = True )
149
+ utils .create_path_and_add_data (full_path = host_path , data = "{}" , is_file = True )
150
150
elif not os .path .exists (host_path ):
151
151
# If the local directory of a mount entry doesn't exist, docker will by
152
152
# default create a directory in that path. Docker runs in systemd context,
0 commit comments