Skip to content

Instantly share code, notes, and snippets.

View yosifkit's full-sized avatar
:octocat:

yosifkit

:octocat:
View GitHub Profile
#!/bin/bash
set -e
str='docker run'
str+=' {{printf "--name=%q" .Name}}'
str+='{{if (eq .HostConfig.NetworkMode "bridge")}} {{printf "--hostname=%q" .Config.Hostname}}{{else}} {{printf "--net=%q" .HostConfig.NetworkMode}}{{end}}'
str+='{{if .Config.OpenStdin}} --interactive{{end}}'
str+='{{if .Config.Tty}} --tty{{end}}'