mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 20:20:39 +00:00
implementing the support for the registry mirror
This commit is contained in:
parent
204616b78f
commit
a76e08c4fd
1
DOCS.md
1
DOCS.md
@ -8,6 +8,7 @@ The following parameters are used to configure this plugin:
|
|||||||
* `repo` - repository name for the image
|
* `repo` - repository name for the image
|
||||||
* `tag` - repository tag for the image
|
* `tag` - repository tag for the image
|
||||||
* `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
|
||||||
* `storage_driver` - use `aufs`, `devicemapper`, `btrfs` or `overlay` driver
|
* `storage_driver` - use `aufs`, `devicemapper`, `btrfs` or `overlay` driver
|
||||||
* `archive` - save and restore image layers to/from a tarred archive
|
* `archive` - save and restore image layers to/from a tarred archive
|
||||||
* `file` - absolute or relative path to archive file
|
* `file` - absolute or relative path to archive file
|
||||||
|
4
main.go
4
main.go
@ -20,6 +20,7 @@ type Archive struct {
|
|||||||
type Docker struct {
|
type Docker struct {
|
||||||
Storage string `json:"storage_driver"`
|
Storage string `json:"storage_driver"`
|
||||||
Registry string `json:"registry"`
|
Registry string `json:"registry"`
|
||||||
|
Mirror string `json:"mirror"`
|
||||||
Insecure bool `json:"insecure"`
|
Insecure bool `json:"insecure"`
|
||||||
Username string `json:"username"`
|
Username string `json:"username"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
@ -82,6 +83,9 @@ func main() {
|
|||||||
if vargs.Insecure && len(vargs.Registry) != 0 {
|
if vargs.Insecure && len(vargs.Registry) != 0 {
|
||||||
args = append(args, "--insecure-registry", vargs.Registry)
|
args = append(args, "--insecure-registry", vargs.Registry)
|
||||||
}
|
}
|
||||||
|
if len(vargs.Mirror) != 0 {
|
||||||
|
args = append(args, "--registry-mirror", vargs.Mirror)
|
||||||
|
}
|
||||||
|
|
||||||
for _, value := range vargs.Dns {
|
for _, value := range vargs.Dns {
|
||||||
args = append(args, "--dns", value)
|
args = append(args, "--dns", value)
|
||||||
|
Loading…
Reference in New Issue
Block a user