mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Embed Docker 1.13.1 (but force protocol 1.22)
This commit is contained in:
@@ -43,6 +43,7 @@ scope.tar
|
||||
prog/scope
|
||||
docker/scope
|
||||
docker/docker.tgz
|
||||
docker/docker
|
||||
docker/weave
|
||||
docker/weaveutil
|
||||
docker/runsvinit
|
||||
|
||||
@@ -12,7 +12,7 @@ SCOPE_BACKEND_BUILD_IMAGE=$(DOCKERHUB_USER)/scope-backend-build
|
||||
SCOPE_BACKEND_BUILD_UPTODATE=.scope_backend_build.uptodate
|
||||
SCOPE_VERSION=$(shell git rev-parse --short HEAD)
|
||||
WEAVENET_VERSION=1.9.0
|
||||
DOCKER_VERSION=1.10.3
|
||||
DOCKER_VERSION=1.13.1
|
||||
DOCKER_DISTRIB=.pkg/docker-$(DOCKER_VERSION).tgz
|
||||
DOCKER_DISTRIB_URL=https://get.docker.com/builds/Linux/x86_64/docker-$(DOCKER_VERSION).tgz
|
||||
RUNSVINIT=vendor/runsvinit/runsvinit
|
||||
@@ -49,6 +49,7 @@ docker/weaveutil:
|
||||
$(SCOPE_EXPORT): $(SCOPE_EXE) $(DOCKER_DISTRIB) docker/weave docker/weaveutil $(RUNSVINIT) docker/Dockerfile docker/demo.json docker/run-app docker/run-probe docker/entrypoint.sh
|
||||
cp $(SCOPE_EXE) $(RUNSVINIT) docker/
|
||||
cp $(DOCKER_DISTRIB) docker/docker.tgz
|
||||
cd docker && tar -xvzf docker.tgz
|
||||
$(SUDO) docker build -t $(SCOPE_IMAGE) docker/
|
||||
$(SUDO) docker tag $(SCOPE_IMAGE) $(SCOPE_IMAGE):$(IMAGE_TAG)
|
||||
$(SUDO) docker save $(SCOPE_IMAGE):latest > $@
|
||||
|
||||
+12
-3
@@ -7,6 +7,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
@@ -15,6 +16,8 @@ import (
|
||||
"github.com/weaveworks/common/exec"
|
||||
)
|
||||
|
||||
const dockerAPIVersion = "1.22" // Support Docker Engine >= 1.10
|
||||
|
||||
// Client for Weave Net API
|
||||
type Client interface {
|
||||
Status() (Status, error)
|
||||
@@ -160,7 +163,7 @@ func (c *client) AddDNSEntry(fqdn, containerID string, ip net.IP) error {
|
||||
}
|
||||
|
||||
func (c *client) PS() (map[string]PSEntry, error) {
|
||||
cmd := exec.Command("weave", "--local", "ps")
|
||||
cmd := weaveCommand("--local", "ps")
|
||||
out, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -199,7 +202,7 @@ func (c *client) PS() (map[string]PSEntry, error) {
|
||||
}
|
||||
|
||||
func (c *client) Expose() error {
|
||||
output, err := exec.Command("weave", "--local", "ps", "weave:expose").Output()
|
||||
output, err := weaveCommand("--local", "ps", "weave:expose").Output()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -208,8 +211,14 @@ func (c *client) Expose() error {
|
||||
// Alread exposed!
|
||||
return nil
|
||||
}
|
||||
if err := exec.Command("weave", "--local", "expose").Run(); err != nil {
|
||||
if err := weaveCommand("--local", "expose").Run(); err != nil {
|
||||
return fmt.Errorf("Error running weave expose: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func weaveCommand(arg ...string) exec.Cmd {
|
||||
cmd := exec.Command("weave", arg...)
|
||||
cmd.SetEnv(append(os.Environ(), "DOCKER_API_VERSION="+dockerAPIVersion))
|
||||
return cmd
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ LABEL works.weave.role=system
|
||||
WORKDIR /home/weave
|
||||
RUN apk add --update bash runit conntrack-tools iproute2 util-linux curl && \
|
||||
rm -rf /var/cache/apk/*
|
||||
ADD ./docker.tgz /
|
||||
ADD ./docker/docker /usr/local/bin/docker
|
||||
ADD ./demo.json /
|
||||
ADD ./weave ./weaveutil /usr/bin/
|
||||
COPY ./scope ./runsvinit ./entrypoint.sh /home/weave/
|
||||
|
||||
Reference in New Issue
Block a user