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

Merge pull request #15 from atosatto/mirror-registry

Adding support to registry mirroring
This commit is contained in:
Brad Rydzewski 2015-11-24 22:50:21 -08:00
commit 0b2faea192
2 changed files with 8 additions and 3 deletions

View File

@ -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
* `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
@ -108,15 +109,15 @@ This error occurs when trying to use the `overlay` storage Driver but overlay is
``` ```
level=error msg="'overlay' not found as a supported filesystem on this host. level=error msg="'overlay' not found as a supported filesystem on this host.
Please ensure kernel is new enough and has overlay support loaded." Please ensure kernel is new enough and has overlay support loaded."
level=fatal msg="Error starting daemon: error initializing graphdriver: driver not supported" level=fatal msg="Error starting daemon: error initializing graphdriver: driver not supported"
``` ```
This error occurs when using CentOS or RedHat which default to the `devicemapper` storage driver: This error occurs when using CentOS or RedHat which default to the `devicemapper` storage driver:
``` ```
level=error msg="There are no more loopback devices available." level=error msg="There are no more loopback devices available."
level=fatal msg="Error starting daemon: error initializing graphdriver: loopback mounting failed" level=fatal msg="Error starting daemon: error initializing graphdriver: loopback mounting failed"
Cannot connect to the Docker daemon. Is 'docker -d' running on this host? Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
``` ```

View File

@ -22,6 +22,7 @@ type Save 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"`
@ -91,6 +92,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)