mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Clean up image construction
- Skip `docker inspect`; `docker pull` is idempotent - Remove unnecessary CMD directives in Dockerfiles - Run bazel before building images to catch errors sooner PiperOrigin-RevId: 331107815
This commit is contained in:
committed by
gVisor bot
parent
365545855f
commit
964447c8ce
+3
-3
@@ -61,7 +61,7 @@ local_image = $(LOCAL_IMAGE_PREFIX)/$(subst _,/,$(1))
|
||||
# conflicting with the bazel "build" terminology, which is used elsewhere.
|
||||
rebuild-%: FROM=$(shell grep FROM $(call path,$*)/Dockerfile | cut -d' ' -f2)
|
||||
rebuild-%: register-cross
|
||||
$(foreach IMAGE,$(FROM),docker pull $(DOCKER_PLATFORM_ARGS) $(IMAGE) &&) true && \
|
||||
$(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 && \
|
||||
rm -rf $$T
|
||||
@@ -73,10 +73,10 @@ pull-%:
|
||||
docker pull $(DOCKER_PLATFORM_ARGS) $(call remote_image,$*)
|
||||
|
||||
# load will either pull the "remote" or build it locally. This is the preferred
|
||||
# entrypoint, as it should never file. The local tag should always be set after
|
||||
# entrypoint, as it should never fail. The local tag should always be set after
|
||||
# this returns (either by the pull or the build).
|
||||
load-%:
|
||||
docker inspect $(call remote_image,$*) >/dev/null 2>&1 || $(MAKE) pull-$* || $(MAKE) rebuild-$*
|
||||
$(MAKE) pull-$* || $(MAKE) rebuild-$*
|
||||
docker tag $(call remote_image,$*) $(call local_image,$*)
|
||||
|
||||
# push pushes the remote image, after either pulling (to validate that the tag
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
FROM ubuntu:bionic
|
||||
RUN apt-get update && apt-get install -y net-tools git iptables iputils-ping \
|
||||
netcat tcpdump jq tar bison flex make
|
||||
# Pick up updated git.
|
||||
RUN hash -r
|
||||
RUN git clone --depth 1 --branch packetdrill-v2.0 \
|
||||
https://github.com/google/packetdrill.git
|
||||
RUN cd packetdrill/gtests/net/packetdrill && ./configure && make
|
||||
CMD /bin/bash
|
||||
|
||||
@@ -16,5 +16,3 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
qemu-system-x86 \
|
||||
# sha1sum to generate entropy.
|
||||
libdigest-sha-perl
|
||||
RUN hash -r
|
||||
CMD /bin/bash
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
source $(dirname $0)/common.sh
|
||||
|
||||
make load-packetdrill
|
||||
QUERY_RESULT=$(query 'attr(tags, manual, tests(//test/packetdrill/...))')
|
||||
|
||||
install_runsc_for_test runsc-d
|
||||
QUERY_RESULT=$(query "attr(tags, manual, tests(//test/packetdrill/...))")
|
||||
make load-packetdrill
|
||||
test_runsc $QUERY_RESULT
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
|
||||
source $(dirname $0)/common.sh
|
||||
|
||||
make load-packetimpact
|
||||
|
||||
QUERY_RESULT=$(query 'attr(tags, packetimpact, tests(//test/packetimpact/...))')
|
||||
|
||||
install_runsc_for_test runsc-d
|
||||
QUERY_RESULT=$(query "attr(tags, packetimpact, tests(//test/packetimpact/...))")
|
||||
make load-packetimpact
|
||||
test_runsc $QUERY_RESULT
|
||||
|
||||
Reference in New Issue
Block a user