Skip to content

Commit

Permalink
Ordered the packages in the Dockerfile and fixed / optimized the cach…
Browse files Browse the repository at this point in the history
…etool
  • Loading branch information
eXistenZNL committed May 19, 2017
1 parent 0dcb9d2 commit 80743d0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
32 changes: 15 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ MAINTAINER [email protected]
ENV LANG='en_US.UTF-8' LANGUAGE='en_US.UTF-8' TERM='xterm' DOCKER_HOST='docker'

RUN apk -U --no-cache add \
alpine-sdk \
autoconf \
automake \
build-base \
curl \
git \
docker \
git \
libjpeg-turbo \
libjpeg-turbo-dev \
libpng \
libpng-dev \
libwebp \
libwebp-dev \
make \
automake \
nasm \
nodejs-current-npm \
php7 \
php7-ctype \
Expand All @@ -21,24 +31,12 @@ RUN apk -U --no-cache add \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-phar \
php7-tokenizer \
php7-session \
php7-simplexml \
php7-tokenizer \
php7-zip \
php7-zlib \
alpine-sdk \
nasm \
autoconf \
build-base \
zlib \
zlib-dev \
libpng \
libpng-dev \
libwebp \
libwebp-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
&& curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& npm install -g yarn
&& curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& npm install -g yarn

COPY cache-tool.sh /usr/local/bin/cache-tool
13 changes: 4 additions & 9 deletions cache-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ function usage() {
exit 1
}

function getCachePaths() {
IFS=:
set $1
}

function collectCache() {
IFS=:
set $1
Expand All @@ -38,22 +33,22 @@ function extractCache() {
IFS=:
set $1
eval dir=$2
if [ ! -d $1 ]; then
echo " ! Cache directory $1 does not exist, skipping..."
if [ ! -d .cache/$1 ]; then
echo " ! Cache directory .cache/$1 does not exist, skipping..."
return
fi
echo " - Extracting .cache/$1 into $2...";
mkdir -p $dir && rm -rf $dir
cp -R .cache/$1 $dir
}

# ==== Start of the program7
# ==== Start of the program

if [ $# -lt 2 ]; then
usage;
fi

if [[ "$1" -ne "collect" && "$1" -ne "extract" ]]; then
if [[ "$1" != "collect" && "$1" != "extract" ]]; then
usage;
fi

Expand Down

0 comments on commit 80743d0

Please sign in to comment.