diff options
Diffstat (limited to 'images')
-rw-r--r-- | images/Makefile | 13 | ||||
-rw-r--r-- | images/basic/mysql/Dockerfile | 2 | ||||
-rw-r--r-- | images/basic/tomcat/Dockerfile.aarch64 | 1 | ||||
-rw-r--r-- | images/benchmarks/nginx/Dockerfile | 1 | ||||
-rw-r--r-- | images/benchmarks/nginx/nginx_gofer.conf | 19 | ||||
-rw-r--r-- | images/jekyll/Dockerfile.x86_64 (renamed from images/jekyll/Dockerfile) | 0 |
6 files changed, 32 insertions, 4 deletions
diff --git a/images/Makefile b/images/Makefile index d4b6524ba..12927c509 100644 --- a/images/Makefile +++ b/images/Makefile @@ -23,7 +23,7 @@ ARCH := $(shell uname -m) # tests are using locally-defined images (that are consistent and idempotent). REMOTE_IMAGE_PREFIX ?= gcr.io/gvisor-presubmit LOCAL_IMAGE_PREFIX ?= gvisor.dev/images -ALL_IMAGES := $(subst /,_,$(subst ./,,$(shell find . -name Dockerfile -exec dirname {} \;))) +ALL_IMAGES := $(subst /,_,$(subst ./,,$(shell find . -name Dockerfile -o -name Dockerfile.$(ARCH) | xargs -n 1 dirname | uniq))) ifneq ($(ARCH),$(shell uname -m)) DOCKER_PLATFORM_ARGS := --platform=$(ARCH) else @@ -51,6 +51,7 @@ load-%-images: # ensuring that images will always be sourced using the local files if there # are changes. path = $(subst _,/,$(1)) +dockerfile = $$(if [ -f "$(call path,$(1))/Dockerfile.$(ARCH)" ]; then echo Dockerfile.$(ARCH); else echo Dockerfile; fi) tag = $(shell find $(call path,$(1)) -type f -print | sort | xargs -n 1 sha256sum | sha256sum - | cut -c 1-16) remote_image = $(REMOTE_IMAGE_PREFIX)/$(subst _,/,$(1))_$(ARCH):$(call tag,$(1)) local_image = $(LOCAL_IMAGE_PREFIX)/$(subst _,/,$(1)) @@ -59,11 +60,17 @@ local_image = $(LOCAL_IMAGE_PREFIX)/$(subst _,/,$(1)) # we need to explicitly repull the base layer in order to ensure that the # architecture is correct. Note that we use the term "rebuild" here to avoid # conflicting with the bazel "build" terminology, which is used elsewhere. -rebuild-%: FROM=$(shell grep FROM $(call path,$*)/Dockerfile | cut -d' ' -f2) +rebuild-%: FROM=$(shell grep FROM "$(call path,$*)/$(call dockerfile,$*)" | cut -d' ' -f2) rebuild-%: register-cross + @if ! [ -f "$(call path,$*)/$(call dockerfile,$*)" ]; then \ + (echo "ERROR: Dockerfile for $* not found (is it available for $(ARCH)?)." >&2 && exit 1); \ + fi $(foreach IMAGE,$(FROM),docker pull $(DOCKER_PLATFORM_ARGS) $(IMAGE) &&) \ T=$$(mktemp -d) && cp -a $(call path,$*)/* $$T && \ - docker build $(DOCKER_PLATFORM_ARGS) -t $(call remote_image,$*) $$T && \ + docker build $(DOCKER_PLATFORM_ARGS) \ + -f "$$T/$(call dockerfile,$*)" \ + -t "$(call remote_image,$*)" \ + $$T && \ rm -rf $$T # pull will check the "remote" image and pull if necessary. If the remote image diff --git a/images/basic/mysql/Dockerfile b/images/basic/mysql/Dockerfile index 95da9c48d..d87bfe55b 100644 --- a/images/basic/mysql/Dockerfile +++ b/images/basic/mysql/Dockerfile @@ -1 +1 @@ -FROM mysql:8.0.19 +FROM mysql/mysql-server:8.0.19 diff --git a/images/basic/tomcat/Dockerfile.aarch64 b/images/basic/tomcat/Dockerfile.aarch64 new file mode 100644 index 000000000..ed4096de9 --- /dev/null +++ b/images/basic/tomcat/Dockerfile.aarch64 @@ -0,0 +1 @@ +FROM arm64v8/tomcat:8.0 diff --git a/images/benchmarks/nginx/Dockerfile b/images/benchmarks/nginx/Dockerfile index 2444d04b1..c8e3330d0 100644 --- a/images/benchmarks/nginx/Dockerfile +++ b/images/benchmarks/nginx/Dockerfile @@ -9,3 +9,4 @@ RUN mkdir -p /local && \ RUN touch /local/index.html COPY ./nginx.conf /etc/nginx/nginx.conf +COPY ./nginx_gofer.conf /etc/nginx/nginx_gofer.conf diff --git a/images/benchmarks/nginx/nginx_gofer.conf b/images/benchmarks/nginx/nginx_gofer.conf new file mode 100644 index 000000000..dbba2a575 --- /dev/null +++ b/images/benchmarks/nginx/nginx_gofer.conf @@ -0,0 +1,19 @@ +user nginx; +worker_processes 1; +daemon off; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + + +http { + server { + location / { + root /local; + } + } +} diff --git a/images/jekyll/Dockerfile b/images/jekyll/Dockerfile.x86_64 index ae19f3bfc..ae19f3bfc 100644 --- a/images/jekyll/Dockerfile +++ b/images/jekyll/Dockerfile.x86_64 |