prepare_build.sh 908 B

123456789101112131415161718
  1. #!/bin/bash
  2. # Move docker's storage location to scratch disk so we don't run out of space.
  3. echo 'DOCKER_OPTS="${DOCKER_OPTS} --graph=/tmpfs/docker"' | sudo tee --append /etc/default/docker
  4. # Use container registry mirror for pulling docker images (should make downloads faster)
  5. # See https://cloud.google.com/container-registry/docs/using-dockerhub-mirroring
  6. echo 'DOCKER_OPTS="${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io"' | sudo tee --append /etc/default/docker
  7. sudo service docker restart
  8. # Download Docker images from DockerHub
  9. DOCKERHUB_ORGANIZATION=protobuftesting
  10. DOCKERFILE_DIR=kokoro/linux/dockerfile/release/ruby_rake_compiler
  11. DOCKERFILE_PREFIX=$(basename $DOCKERFILE_DIR)
  12. export RAKE_COMPILER_DOCK_IMAGE=${DOCKERHUB_ORGANIZATION}/${DOCKERFILE_PREFIX}_$(sha1sum $DOCKERFILE_DIR/Dockerfile | cut -f1 -d\ )
  13. # All artifacts come here
  14. mkdir artifacts
  15. export ARTIFACT_DIR=$(pwd)/artifacts