瀏覽代碼

Merge pull request #2192 from fcrisciani/circle-multistage

Multistage for build
Flavio Crisciani 7 年之前
父節點
當前提交
3a5f106ec3

+ 6 - 1
libnetwork/.circleci/config.yml

@@ -5,7 +5,7 @@ defaults: &defaults
   docker:
     - image: 'circleci/golang:1.10'
       environment:
-          dockerbuildargs: -f Dockerfile.ci .
+          dockerbuildargs: .
           dockerargs:  --privileged -e CIRCLECI
 
 jobs:
@@ -14,6 +14,7 @@ jobs:
     steps:
       - checkout
       - setup_remote_docker:
+          version: 18.05.0-ce
           reusable: true
           exclusive: false
       - run: make builder
@@ -23,6 +24,7 @@ jobs:
     steps:
       - checkout
       - setup_remote_docker:
+          version: 18.05.0-ce
           reusable: true
           exclusive: false
       - run: make build
@@ -32,6 +34,7 @@ jobs:
     steps:
       - checkout
       - setup_remote_docker:
+          version: 18.05.0-ce
           reusable: true
           exclusive: false
       - run: make check
@@ -41,6 +44,7 @@ jobs:
     steps:
       - checkout
       - setup_remote_docker:
+          version: 18.05.0-ce
           reusable: true
           exclusive: false
       - run: make cross
@@ -50,6 +54,7 @@ jobs:
     steps:
       - checkout
       - setup_remote_docker:
+          version: 18.05.0-ce
           reusable: true
           exclusive: false
       - run: make unit-tests

+ 3 - 1
libnetwork/Dockerfile.ci → libnetwork/Dockerfile

@@ -1,4 +1,4 @@
-FROM golang:1.10
+FROM golang:1.10.2 as dev
 RUN apt-get update && apt-get -y install iptables
 
 RUN go get github.com/golang/lint/golint \
@@ -10,4 +10,6 @@ RUN go get github.com/golang/lint/golint \
 
 WORKDIR /go/src/github.com/docker/libnetwork
 
+FROM dev
+
 COPY . .

+ 0 - 11
libnetwork/Dockerfile.build

@@ -1,11 +0,0 @@
-FROM golang:1.10.2
-RUN apt-get update && apt-get -y install iptables
-
-RUN go get github.com/golang/lint/golint \
-		golang.org/x/tools/cmd/cover \
-		github.com/mattn/goveralls \
-		github.com/gordonklaus/ineffassign \
-		github.com/client9/misspell/cmd/misspell \
-		honnef.co/go/tools/cmd/gosimple
-
-WORKDIR /go/src/github.com/docker/libnetwork

+ 1 - 1
libnetwork/Makefile

@@ -1,6 +1,6 @@
 .PHONY: all all-local build build-local clean cross cross-local gosimple vet lint misspell check check-local check-code check-format unit-tests
 SHELL=/bin/bash
-dockerbuildargs ?= - < Dockerfile.build
+dockerbuildargs ?= --target dev - < Dockerfile
 dockerargs ?= --privileged -v $(shell pwd):/go/src/github.com/docker/libnetwork -w /go/src/github.com/docker/libnetwork
 build_image=libnetworkbuild
 container_env = -e "INSIDECONTAINER=-incontainer=true"

+ 1 - 2
libnetwork/osl/sandbox_linux_test.go

@@ -76,7 +76,7 @@ func newInfo(hnd *netlink.Handle, t *testing.T) (Sandbox, error) {
 	intf1.address = addr
 	intf1.address.IP = ip4
 
-	ip6, addrv6, err := net.ParseCIDR("2001:DB8::ABCD/48")
+	ip6, addrv6, err := net.ParseCIDR("fe80::2/64")
 	if err != nil {
 		return nil, err
 	}
@@ -111,7 +111,6 @@ func newInfo(hnd *netlink.Handle, t *testing.T) (Sandbox, error) {
 	info := &networkNamespace{iFaces: []*nwIface{intf1, intf2, intf3}}
 
 	info.gw = net.ParseIP("192.168.1.1")
-	// sinfo.GatewayIPv6 = net.ParseIP("2001:DB8::1")
 	info.gwv6 = net.ParseIP("fe80::1")
 
 	return info, nil

+ 0 - 1
libnetwork/osl/sandbox_test.go

@@ -29,7 +29,6 @@ func TestSandboxCreate(t *testing.T) {
 	if err != nil {
 		t.Fatalf("Failed to create a new sandbox: %v", err)
 	}
-	runtime.LockOSThread()
 
 	if s.Key() != key {
 		t.Fatalf("s.Key() returned %s. Expected %s", s.Key(), key)