Merge pull request #13157 from jtattermusch/docker_faster_pulls

User GCR mirror for pulling docker images
pull/13067/merge
Jan Tattermusch 7 years ago committed by GitHub
commit 21c6405dea
  1. 3
      tools/internal_ci/helper_scripts/prepare_build_linux_rc
  2. 4
      tools/run_tests/dockerize/build_and_run_docker.sh
  3. 2
      tools/run_tests/dockerize/build_docker_and_run_tests.sh
  4. 2
      tools/run_tests/dockerize/build_interop_image.sh

@ -22,6 +22,9 @@ ulimit -n 32768
# Move docker's storage location to scratch disk so we don't run out of space. # Move docker's storage location to scratch disk so we don't run out of space.
echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
# Use container registry mirror for pulling docker images (should make downloads faster)
# See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring
echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker
sudo service docker restart sudo service docker restart
# Populate xdg-cache-home to workaround https://github.com/grpc/grpc/issues/11968 # Populate xdg-cache-home to workaround https://github.com/grpc/grpc/issues/11968

@ -36,13 +36,13 @@ DOCKER_IMAGE_NAME=$(basename $DOCKERFILE_DIR)_$(sha1sum $DOCKERFILE_DIR/Dockerfi
# Pull the base image to force an update # Pull the base image to force an update
if [ "$DOCKER_BASE_IMAGE" != "" ] if [ "$DOCKER_BASE_IMAGE" != "" ]
then then
docker pull $DOCKER_BASE_IMAGE time docker pull $DOCKER_BASE_IMAGE
fi fi
if [ "$DOCKERHUB_ORGANIZATION" != "" ] if [ "$DOCKERHUB_ORGANIZATION" != "" ]
then then
DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME
docker pull $DOCKER_IMAGE_NAME time docker pull $DOCKER_IMAGE_NAME
else else
# Make sure docker image has been built. Should be instantaneous if so. # Make sure docker image has been built. Should be instantaneous if so.
docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR

@ -40,7 +40,7 @@ DOCKER_IMAGE_NAME=$(basename $DOCKERFILE_DIR)_$(sha1sum $DOCKERFILE_DIR/Dockerfi
if [ "$DOCKERHUB_ORGANIZATION" != "" ] if [ "$DOCKERHUB_ORGANIZATION" != "" ]
then then
DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME DOCKER_IMAGE_NAME=$DOCKERHUB_ORGANIZATION/$DOCKER_IMAGE_NAME
docker pull $DOCKER_IMAGE_NAME time docker pull $DOCKER_IMAGE_NAME
else else
# Make sure docker image has been built. Should be instantaneous if so. # Make sure docker image has been built. Should be instantaneous if so.
docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR docker build -t $DOCKER_IMAGE_NAME $DOCKERFILE_DIR

@ -78,7 +78,7 @@ fi
if [ "$DOCKERHUB_ORGANIZATION" != "" ] if [ "$DOCKERHUB_ORGANIZATION" != "" ]
then then
BASE_IMAGE=$DOCKERHUB_ORGANIZATION/$BASE_IMAGE BASE_IMAGE=$DOCKERHUB_ORGANIZATION/$BASE_IMAGE
docker pull $BASE_IMAGE time docker pull $BASE_IMAGE
else else
# Make sure docker image has been built. Should be instantaneous if so. # Make sure docker image has been built. Should be instantaneous if so.
docker build -t $BASE_IMAGE --force-rm=true tools/dockerfile/interoptest/$BASE_NAME || exit $? docker build -t $BASE_IMAGE --force-rm=true tools/dockerfile/interoptest/$BASE_NAME || exit $?

Loading…
Cancel
Save