From 7550c5ebb4435f4ce0eee8d79f4923b7bb23ad16 Mon Sep 17 00:00:00 2001 From: Denis Zheleztsov Date: Fri, 11 Nov 2016 17:34:29 +0300 Subject: [PATCH] surok on alpine build --- build/build.sh | 53 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/build/build.sh b/build/build.sh index 3a0e3be..2ef43e4 100755 --- a/build/build.sh +++ b/build/build.sh @@ -9,18 +9,21 @@ function cleanup() { rm -f ./Dockerfile* } +function copy_surok() { + mkdir -p ./surok + for f in ../*; do + if [[ $f != '../.git' ]] && [[ $f != '../build' ]]; then + cp -r $f ./surok; + fi + done + + SUROK_DEPS=$(grep '^Depends:' surok/debian/control | awk -F': ' '{print $2}' | sed 's/,//g') + CUR_DIR=$(pwd) +} + function build_builder() { - mkdir -p ./surok - for f in ../*; do - if [[ $f != '../.git' ]] && [[ $f != '../build' ]]; then - cp -r $f ./surok; - fi - done - - SUROK_DEPS=$(grep '^Depends:' surok/debian/control | awk -F': ' '{print $2}' | sed 's/,//g') - CUR_DIR=$(pwd) - - cat > Dockerfile.builder < Dockerfile.builder < Dockerfile.alpine << EOF +FROM alpine:latest + +MAINTAINER Denis Zheleztsov + +# Install Python +RUN apk update && apk add python3 + +# Upgrade pip +RUN pip3 install --upgrade pip + +RUN pip3 install dnspython +RUN pip3 install jinja2 +RUN pip3 install requests +RUN pip3 install python-memcached + +COPY surok /opt/surok + +ENTRYPOINT cd /opt/surok && python3 surok.py -c /etc/surok/conf/surok.json +EOF +docker build -t surok_alpine -f Dockerfile.alpine . +} + function usage() { - echo "$0 " + echo "$0 " } case $1 in @@ -83,5 +111,6 @@ case $1 in build_deb) build_package ;; surok_image) build_surok_base rebuild ;; surok_image_no_rebuild) build_surok_base ;; + alpine) build_alpine ;; *) usage ;; esac