bundles/docker-engine: support different user, arbitrary mapped volumes, custom command
This commit is contained in:
parent
e0903ffa50
commit
f04149b4a7
2 changed files with 25 additions and 9 deletions
|
@ -12,8 +12,8 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
PUID="$(id -u "docker-${name}")"
|
||||
PGID="$(id -g "docker-${name}")"
|
||||
PUID="$(id -u "${user}")"
|
||||
PGID="$(id -g "${user}")"
|
||||
|
||||
if [ "$ACTION" == "start" ]
|
||||
then
|
||||
|
@ -32,10 +32,19 @@ then
|
|||
--publish "127.0.0.1:${host_port}:${container_port}" \
|
||||
% endfor
|
||||
% for host_path, container_path in sorted(volumes.items()):
|
||||
% if host_path.startswith('/'):
|
||||
--volume "${host_path}:${container_path}" \
|
||||
% else:
|
||||
--volume "/var/opt/docker-engine/${name}/${host_path}:${container_path}" \
|
||||
% endif
|
||||
% endfor
|
||||
--restart unless-stopped \
|
||||
% if command:
|
||||
"${image}" \
|
||||
"${command}"
|
||||
% else:
|
||||
"${image}"
|
||||
% endif
|
||||
|
||||
elif [ "$ACTION" == "stop" ]
|
||||
then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue