Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the pause image to build for arm64 and ppc64le #23697

Merged
merged 1 commit into from
Apr 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.