Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Remove image layer caching (#6)
Browse files Browse the repository at this point in the history
Remove image layer caching
  • Loading branch information
rnorth authored Oct 25, 2019
2 parents d2732e7 + 517063d commit af17e42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This plugin:
* Starts a nested docker daemon
* Optionally starts a pull of required images (in parallel with your build, so as to reduce overall time spent waiting for images to be pulled)
* Starts a specified build container inside the Docker-in-Docker context, containing your source code and with a docker socket available to it
* Stores/restores image layers within the CI workspace, for best efforts caching. Even when cached, images will still be pulled to enforce up-to-date checks.

## Prerequisites

Expand Down
20 changes: 0 additions & 20 deletions command.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

set -euo pipefail # Abort on error, strict variable interpolation, fail if piped command fails
IMAGE_CACHE_DIR=${CI_WORKSPACE}/.dind

if [[ "${PLUGIN_CMD:-}" == "" ]]; then
echo "One or more cmd arguments must be provided"
Expand Down Expand Up @@ -33,16 +32,6 @@ done
docker ps &> /dev/null || exit 1
echo "✅ Docker-in-Docker is running..."

set +e
if [[ -d $IMAGE_CACHE_DIR ]]; then
echo "💾 Importing docker images from cache ($IMAGE_CACHE_DIR)"
for IMAGE in $(ls $IMAGE_CACHE_DIR); do
cat $IMAGE_CACHE_DIR/$IMAGE | gunzip | docker image load
done
fi
set -e


if [[ "${PLUGIN_DOCKER_LOGIN_COMMAND:-}" != "" ]]; then
echo "🛠 Executing Docker login command"
sh -c "${PLUGIN_DOCKER_LOGIN_COMMAND}" 2>&1 | sed "s/^/ /g"
Expand Down Expand Up @@ -98,13 +87,4 @@ echo "🏁 Exit code: $CMD_EXIT_CODE"

rm outer_env_vars.env

mkdir -p $IMAGE_CACHE_DIR
docker image prune -f
echo "💾 Exporting docker images to cache ($IMAGE_CACHE_DIR)"
for IMAGE in $(docker image ls -q); do
if [[ ! -f $IMAGE_CACHE_DIR/$IMAGE.tar.gz ]]; then
docker image save $IMAGE | gzip > $IMAGE_CACHE_DIR/$IMAGE.tar.gz
fi
done

exit $CMD_EXIT_CODE

0 comments on commit af17e42

Please sign in to comment.