Skip to content

Commit

Permalink
add s390x support for image gb-frontend and gb-redisslave in gcr.io/g…
Browse files Browse the repository at this point in the history
…oogle-samples
  • Loading branch information
liudalibj committed May 13, 2019
1 parent c4cfecb commit 63a09b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
3 changes: 3 additions & 0 deletions guestbook/php-redis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

FROM php:5-apache

COPY fixup-apt-list.sh /
RUN ["/fixup-apt-list.sh"]

RUN apt-get update
RUN pear channel-discover pear.nrk.io
RUN pear install nrk/Predis
Expand Down
7 changes: 5 additions & 2 deletions guestbook/php-redis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
TAG = v6
REGISTRY = gcr.io/google-samples
ARCH ?= $(shell go env GOARCH)
ALL_ARCH = amd64 arm arm64 ppc64le
ALL_ARCH = amd64 arm arm64 ppc64le s390x

QEMUVERSION=v2.7.0

Expand All @@ -35,7 +35,10 @@ ifeq ($(ARCH),ppc64le)
QEMUARCH=ppc64le
BASEIMAGE=ppc64le/php:5-apache
endif

ifeq ($(ARCH),s390x)
QEMUARCH=s390x
BASEIMAGE=s390x/php:5-apache
endif
TEMP_DIR := $(shell mktemp -d)

all: all-container
Expand Down
15 changes: 15 additions & 0 deletions guestbook/php-redis/fixup-apt-list.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

DEB_ARCH=$(dpkg --print-architecture)

# http://security.debian.org/debian-security/dists/jessie/updates/InRelease is missing
# entries for some platforms, so we just remove the last line in sources.list in
# /etc/apt/sources.list which is "deb http://deb.debian.org/debian jessie-updates main"

case ${DEB_ARCH} in
arm64|ppc64el|s390x)
sed -i '/security/d' /etc/apt/sources.list
;;
esac

exit 0
6 changes: 5 additions & 1 deletion guestbook/redis-slave/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
TAG = v3
REGISTRY = gcr.io/google-samples
ARCH ?= $(shell go env GOARCH)
ALL_ARCH = amd64 arm arm64 ppc64le
ALL_ARCH = amd64 arm arm64 ppc64le s390x

IMAGE = $(REGISTRY)/gb-redisslave
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
Expand All @@ -33,6 +33,10 @@ ifeq ($(ARCH),ppc64le)
QEMUARCH=ppc64le
BASEIMAGE=ppc64le/redis:3.2.9
endif
ifeq ($(ARCH),s390x)
QEMUARCH=s390x
BASEIMAGE=s390x/redis:3.2.9
endif

TEMP_DIR := $(shell mktemp -d)

Expand Down

0 comments on commit 63a09b6

Please sign in to comment.