Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add log-driver parameter #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goxc.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"xc"
],
"BuildConstraints": "linux, windows, darwin",
"PackageVersion": "1.6.0",
"PackageVersion": "1.7.0",
"TaskSettings": {
"xc": {
"GOARM": "7"
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -48,6 +48,8 @@ if [[ $interactivebash == "true" ]]; then
{{range $key, $value := .Service.Environment}}-e {{$key}}="{{$value}}" {{end}} \
{{range .Service.Ports}}-p {{.}} {{end}} \
{{range .Service.Env_File}}--env-file {{.}} {{end}} \
{{if .Service.Log_Driver}}--log-driver {{.Service.Log_Driver}} {{end}} \
{{range $key, $value := .Service.Log_Opt}}--log-opt {{$key}}={{$value}} {{end}} \
{{.Service.Image}} bash
else
/usr/bin/docker {{.DockerHostConnCmdArg}} run \
@@ -62,6 +64,8 @@ else
{{range $key, $value := .Service.Environment}}-e {{$key}}="{{$value}}" {{end}} \
{{range .Service.Ports}}-p {{.}} {{end}} \
{{range .Service.Env_File}}--env-file {{.}} {{end}} \
{{if .Service.Log_Driver}}--log-driver {{.Service.Log_Driver}} {{end}} \
{{range $key, $value := .Service.Log_Opt}}--log-opt {{$key}}={{$value}} {{end}} \
{{.Service.Image}} {{.Service.Command}}
fi
{{else}}
@@ -77,6 +81,8 @@ fi
{{range $key, $value := .Service.Environment}}-e {{$key}}="{{$value}}" {{end}} \
{{range .Service.Ports}}-p {{.}} {{end}} \
{{range .Service.Env_File}}--env-file {{.}} {{end}} \
{{if .Service.Log_Driver}}--log-driver {{.Service.Log_Driver}} {{end}} \
{{range $key, $value := .Service.Log_Opt}}--log-opt {{$key}}={{$value}} {{end}} \
{{.Service.Image}} {{.Service.Command}}
{{end}}
`
@@ -102,6 +108,8 @@ type Service struct {
Privileged bool
Command string
Environment map[string]string
Log_Driver string
Log_Opt map[string]string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just remove the underscore? Golang pattern does not use underscore for variable names. Also the indentation for the new variables are different from those above.

}

// Parses the original Yaml to the Service struct