Skip to content

Commit

Permalink
Use docker buildx to build docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha committed Aug 9, 2019
1 parent 867a620 commit 000f2c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bin/.container-$(DOTFILE_IMAGE)-%: bin/$(OS)_$(ARCH)/$(BIN) $(DOCKERFILE_%)
-e 's|{RESTIC_VER}|$(RESTIC_VER)|g' \
-e 's|{NEW_RESTIC_VER}|$(NEW_RESTIC_VER)|g' \
$(DOCKERFILE_$*) > bin/.dockerfile-$*-$(OS)_$(ARCH)
@docker build --pull -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
@DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform $(OS)/$(ARCH) --load --pull -t $(IMAGE):$(TAG_$*) -f bin/.dockerfile-$*-$(OS)_$(ARCH) .
@docker images -q $(IMAGE):$(TAG_$*) > $@
@echo

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1 h1:NmVj5+kPpUgoxRans2X
kmodules.xyz/openshift v0.0.0-20190808144841-c8f9a927f1d1/go.mod h1:+E8HHcxBx6ja4oKOXZ6DCoQ+NjujODTgFOfgOe+ejXw=
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b h1:yd/uzBgLgsir3X4kGoznJY7CdrkgfznsNKvD4p2xUaQ=
kmodules.xyz/webhook-runtime v0.0.0-20190808145328-4186c470d56b/go.mod h1:X8J6YJvk3NqufXEDqcl2oFuL8T6+mV+AN30/miV4iJU=
kubedb.dev/apimachinery v0.13.0-rc.0 h1:bsVHuz0ZSR1Hf/e7BAMttH1B0YnuV6Z1sGapuD7fr2Y=
kubedb.dev/apimachinery v0.13.0-rc.0 h1:Ar2BVEbJg4X3kPMyO1PnTvN62FulUQnRxT/0Oi3LQ7w=
kubedb.dev/apimachinery v0.13.0-rc.0/go.mod h1:aW9ZyAPYmxM/t9LxtS9H26Ci2bw0qOYlSDHJPuh6lpM=
labix.org/v2/mgo v0.0.0-20140701140051-000000000287/go.mod h1:Lg7AYkt1uXJoR9oeSZ3W/8IXLdvOfIITgZnommstyz4=
launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM=
Expand All @@ -606,5 +606,5 @@ sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5
sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
stash.appscode.dev/stash v0.9.0-rc.0 h1:vSSzKdoQWS4hKLd7cVWyL6tkTwH8aVEse4RP7kAe/ec=
stash.appscode.dev/stash v0.9.0-rc.0 h1:GhzBnqHYBgq+2bcuwsDK3nhq2PPEhGkBH0EFAXp2OmY=
stash.appscode.dev/stash v0.9.0-rc.0/go.mod h1:/YjAPx/9E4ScxWea1mbJC6qx9TomhqS83AUy2LufVVk=
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ const (
// GarbdLogFile is the name log file at which Galera Arbitrator Daemon (garbd) puts logs
GarbdLogFile = "/tmp/garb.log"

// GaleraParamsGarbdListenAddr defines an arbitrary listen socket address
// that Galera Arbitrator Daemon (garbd) opens to communicate with the cluster
// https://galeracluster.com/library/documentation/backup-cluster.html
GaleraParamsGarbdListenAddr = "gmcast.listen_addr=tcp://0.0.0.0:" + string(GarbdListenPort)

// SOCAT is needed after completing sst by Galera Arbitrator (garbd)
// SOCATOptionTCPLISTEN is the SOCAT tcp listen option
SOCATOptionTCPLISTEN = "TCP-LISTEN:" + string(GarbdListenPort)
// SOCAT is needed after completing sst by Galera Arbitrator Daemon (garbd)
// SOCATOptionReUseAddr is the SOCAT reuseaddr option
SOCATOptionReUseAddr = "reuseaddr"
// SOCATOptionRetry is the default retry value for `socat` binary
Expand All @@ -35,12 +28,15 @@ const (
// ClusterAddressWithListenOption method returns the galera cluster address with
// the listening option (address at which Galera Cluster listens to connections from
// other nodes) for `--address` option in `garbd`
// Here, ‘?gmcast.listen_addr=tcp://0.0.0.0:4444‘ is an arbitrary listen socket address
// that Galera Arbitrator opens to communicate with the cluster.
// https://galeracluster.com/library/documentation/backup-cluster.html
func (g *GaleraArbitratorConfiguration) ClusterAddressWithListenOption() string {
if g == nil {
return ""
}

return fmt.Sprintf("%s?%s", g.Address, GaleraParamsGarbdListenAddr)
return fmt.Sprintf("%s?gmcast.listen_addr=tcp://0.0.0.0:%d", g.Address, GarbdListenPort)
}

// SSTRequestString method form the sst request string
Expand All @@ -56,5 +52,5 @@ func (g *GaleraArbitratorConfiguration) SSTRequestString(host string) string {
// SOCATOption returns the option string used for `SOCAT` in the
// percona xtradb backup process
func SOCATOption(retry int32) string {
return fmt.Sprintf("%s,%s,retry=%d", SOCATOptionTCPLISTEN, SOCATOptionReUseAddr, retry)
return fmt.Sprintf("TCP-LISTEN:%d,%s,retry=%d", GarbdListenPort, SOCATOptionReUseAddr, retry)
}

0 comments on commit 000f2c6

Please sign in to comment.