File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.10
22
3- RUN apt-get update && apt-get install -y zip
3+ RUN apt-get update \
4+ && apt-get install -y zip \
5+ && apt-get install -y sudo libltdl-dev
46
57RUN go get -d golang.org/x/sys/unix
68RUN go get -d github.com/Microsoft/hcsshim
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ CNM_PLUGIN_ROOTFS = azure-vnet-plugin-rootfs
9999AZURE_NPM_IMAGE = containernetworking/azure-npm
100100
101101VERSION ?= $(shell git describe --tags --always --dirty)
102- AZURE_NPM_VERSION = VERSION
102+ AZURE_NPM_VERSION = $( VERSION )
103103
104104ENSURE_OUTPUT_DIR_EXISTS := $(shell mkdir -p $(OUTPUT_DIR ) )
105105
120120all-binaries : azure-cnm-plugin azure-cni-plugin azure-cns
121121endif
122122
123+ all-images : azure-npm-image
124+
123125# Clean all build artifacts.
124126.PHONY : clean
125127clean :
@@ -146,17 +148,20 @@ $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT): $(NPMFILES)
146148 go build -v -o $(NPM_BUILD_DIR ) /azure-npm$(EXE_EXT ) -ldflags " -X main.version=$( VERSION) -s -w" $(NPM_DIR ) /* .go
147149
148150# Build all binaries in a container.
149- .PHONY : all-binaries- containerized
150- all-binaries- containerized :
151+ .PHONY : all-containerized
152+ all-containerized :
151153 pwd && ls -l
152154 docker build -f Dockerfile.build -t $(BUILD_CONTAINER_IMAGE ) :$(VERSION ) .
153155 docker run --name $(BUILD_CONTAINER_NAME ) \
156+ -v /usr/bin/docker:/usr/bin/docker \
157+ -v /var/run/docker.sock:/var/run/docker.sock \
154158 $(BUILD_CONTAINER_IMAGE ) :$(VERSION ) \
155159 bash -c ' \
156160 pwd && ls -l && \
157161 export GOOS=$(GOOS ) && \
158162 export GOARCH=$(GOARCH ) && \
159163 make all-binaries && \
164+ make all-images && \
160165 chown -R $(BUILD_USER ) :$(BUILD_USER ) $(BUILD_DIR ) \
161166 '
162167 docker cp $(BUILD_CONTAINER_NAME ) :$(BUILD_CONTAINER_REPO_PATH ) /$(BUILD_DIR ) $(OUTPUT_DIR )
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- GOOS=$1 GOARCH=$2 make all-binaries-containerized
2+
3+ BUILD_CONTAINER_NAME=acn-builder
4+ GOOS=$1
5+ GOARCH=$2
6+
7+ if [ ! " $( docker ps -q -f name=$BUILD_CONTAINER_NAME ) " ]; then
8+ if [ " $( docker ps -aq -f status=exited -f name=$BUILD_CONTAINER_NAME ) " ]; then
9+ docker rm -f $BUILD_CONTAINER_NAME
10+ fi
11+ fi
12+
13+ make all-containerized
You can’t perform that action at this time.
0 commit comments