0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-22 20:20:39 +00:00

Merge pull request #19 from Bugagazavr/bip-support

Bip support for docker
This commit is contained in:
Brad Rydzewski 2015-11-27 19:38:26 -08:00
commit 773b5a2a9b
2 changed files with 9 additions and 4 deletions

View File

@ -10,6 +10,7 @@ The following parameters are used to configure this plugin:
* `force_tag` - replace existing matched image tags * `force_tag` - replace existing matched image tags
* `insecure` - enable insecure communication to this registry * `insecure` - enable insecure communication to this registry
* `mirror` - use a mirror registry instead of pulling images directly from the central Hub * `mirror` - use a mirror registry instead of pulling images directly from the central Hub
* `bip` - use for pass bridge ip
* `storage_driver` - use `aufs`, `devicemapper`, `btrfs` or `overlay` driver * `storage_driver` - use `aufs`, `devicemapper`, `btrfs` or `overlay` driver
* `save` - save image layers to the specified tar file (see [docker save](https://docs.docker.com/engine/reference/commandline/save/)) * `save` - save image layers to the specified tar file (see [docker save](https://docs.docker.com/engine/reference/commandline/save/))
* `file` - absolute / relative destination path * `file` - absolute / relative destination path

12
main.go
View File

@ -14,9 +14,9 @@ import (
type Save struct { type Save struct {
// Absolute or relative path // Absolute or relative path
File string `json:"destination"` File string `json:"destination"`
// Only save specified tags (optional) // Only save specified tags (optional)
Tags StrSlice `json:"tag"` Tags StrSlice `json:"tag"`
} }
type Docker struct { type Docker struct {
@ -33,6 +33,7 @@ type Docker struct {
Tag StrSlice `json:"tag"` Tag StrSlice `json:"tag"`
File string `json:"file"` File string `json:"file"`
Context string `json:"context"` Context string `json:"context"`
Bip string `json:"bip"`
Dns []string `json:"dns"` Dns []string `json:"dns"`
Load string `json:"load"` Load string `json:"load"`
Save Save `json:"save"` Save Save `json:"save"`
@ -73,13 +74,13 @@ func main() {
} }
// Get absolute path for 'save' file // Get absolute path for 'save' file
if len(vargs.Save.File) != 0 { if len(vargs.Save.File) != 0 {
if ! filepath.IsAbs(vargs.Save.File) { if !filepath.IsAbs(vargs.Save.File) {
vargs.Save.File = filepath.Join(workspace.Path, vargs.Save.File) vargs.Save.File = filepath.Join(workspace.Path, vargs.Save.File)
} }
} }
// Get absolute path for 'load' file // Get absolute path for 'load' file
if len(vargs.Load) != 0 { if len(vargs.Load) != 0 {
if ! filepath.IsAbs(vargs.Load) { if !filepath.IsAbs(vargs.Load) {
vargs.Load = filepath.Join(workspace.Path, vargs.Load) vargs.Load = filepath.Join(workspace.Path, vargs.Load)
} }
} }
@ -96,6 +97,9 @@ func main() {
if len(vargs.Mirror) != 0 { if len(vargs.Mirror) != 0 {
args = append(args, "--registry-mirror", vargs.Mirror) args = append(args, "--registry-mirror", vargs.Mirror)
} }
if len(vargs.Bip) != 0 {
args = append(args, "--bip", vargs.Bip)
}
for _, value := range vargs.Dns { for _, value := range vargs.Dns {
args = append(args, "--dns", value) args = append(args, "--dns", value)