Skip to content

Commit

Permalink
Update the pause image to build for arm64 and ppc64le
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed Apr 1, 2016
1 parent d41d505 commit c214c76
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 37 deletions.
42 changes: 32 additions & 10 deletions build/pause/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,40 @@

.PHONY: build push

TAG = 2.0
TAG=2.0
REGISTRY?="gcr.io/google_containers"

ARCH = amd64
IMAGE = pause
# ARCH = arm
# IMAGE = pause-arm
# Architectures supported: amd64, arm, arm64 and ppc64le
ARCH?=amd64
GOLANG_VERSION=1.6
TEMP_DIR:=$(shell mktemp -d)

all: push-legacy-too

build:
./prepare.sh ${ARCH}
docker build -t gcr.io/google_containers/$(IMAGE):$(TAG) .
cp pause.go Dockerfile $(TEMP_DIR)

docker run -it -v $(TEMP_DIR):/build golang:$(GOLANG_VERSION) /bin/bash -c \
"cd /build && CGO_ENABLED=0 GOARM=6 GOARCH=$(ARCH) go build -a -installsuffix cgo -ldflags '-w' ./pause.go"

ifeq ($(ARCH),$(filter $(ARCH),amd64 arm))
# Run goupx for amd64 and arm. The condition above is equal to 'if [[ $ARCH == "amd64" || $ARCH == "arm" ]]' in bash
docker run -it -v $(TEMP_DIR):/build golang:$(GOLANG_VERSION) /bin/bash -c \
"cd /build && apt-get update && apt-get install -y upx \
&& go get github.com/pwaller/goupx && goupx pause"
endif

# And build the image
docker build -t $(REGISTRY)/pause-$(ARCH):$(TAG) $(TEMP_DIR)

ifeq ($(ARCH),amd64)
docker tag -f $(REGISTRY)/pause-$(ARCH):$(TAG) $(REGISTRY)/pause:$(TAG)
endif

push: build
gcloud docker --server=gcr.io push gcr.io/google_containers/$(IMAGE):$(TAG)
push: build
gcloud docker --server=gcr.io push $(REGISTRY)/pause-$(ARCH):$(TAG)

all: push
push-legacy-too: push
ifeq ($(ARCH),amd64)
gcloud docker push $(REGISTRY)/pause:$(TAG)
endif
27 changes: 0 additions & 27 deletions build/pause/prepare.sh

This file was deleted.

1 comment on commit c214c76

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 20385 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 267 Build time: 00:05:13

Please sign in to comment.