Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reduction docker image size #47

Merged
merged 1 commit into from
Oct 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 15 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,14 @@ MAINTAINER Takatoshi Maeda <me@tmd.tw>
ENV PATH $PATH:/usr/local/go/bin:/usr/local/go/vendor/bin

RUN env DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get build-dep -y imagemagick && \
apt-get install -y libwebp-dev git wget && \
rm -rf /var/lib/apt/lists/*

ENV IMAGEMAGICK_VERSION 6.9.6-2
ENV LD_LIBRARY_PATH /usr/local/lib

RUN mkdir -p /tmp/imagemagick && \
wget http://www.imagemagick.org/download/ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz -q -P /tmp/imagemagick/ && \
cd /tmp/imagemagick && \
tar zxf ImageMagick-${IMAGEMAGICK_VERSION}.tar.gz && \
cd ImageMagick-${IMAGEMAGICK_VERSION} && \
./configure \
--prefix=/usr \
--libdir=/usr/lib/x86_64-linux-gnu \
--with-modules \
--disable-openmp \
--with-jemalloc && \
make && \
make install && \
rm -rf /tmp/imagemagick
apt-get install -y libwebp-dev libmagickwand-dev git wget && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

ENV GOLANG_VERSION 1.6.2
ENV GOROOT /usr/local/go
ENV GOPATH /usr/local/go/vendor

RUN mkdir -p /tmp/golang && \
wget https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz -q -P /tmp/golang && \
cd /tmp/golang && \
tar zxf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
mv ./go /usr/local/go && \
mkdir /usr/local/go/vendor && \
rm -rf /tmp/golang

ENV KINU_VERSION 1.0.0.alpha1
ENV KINU_BIND 0.0.0.0:80
ENV KINU_LOG_LEVEL info
Expand All @@ -46,10 +20,18 @@ ENV KINU_RESIZE_ENGINE ImageMagick
ENV KINU_STORAGE_TYPE File
ENV KINU_FILE_DIRECTORY /var/local/kinu

RUN go get -d github.com/TakatoshiMaeda/kinu && \
cd /usr/local/go/vendor/src/github.com/TakatoshiMaeda/kinu/ && \
RUN mkdir -p /tmp/golang && \
wget https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz -q -P /tmp/golang && \
cd /tmp/golang && \
tar zxf go${GOLANG_VERSION}.linux-amd64.tar.gz && \
mv ./go /usr/local/go && \
mkdir /usr/local/go/vendor && \
go get -d github.com/tokubai/kinu && \
cd /usr/local/go/vendor/src/github.com/tokubai/kinu/ && \
git fetch && git checkout refs/tags/${KINU_VERSION} && \
go build -o /usr/local/go/vendor/bin/kinu . && \
mkdir -p /var/local/kinu
go build -o /usr/local/bin/kinu . && \
mkdir -p /var/local/kinu && \
rm -rf /tmp/golang && \
rm -rf /usr/local/go

CMD ["kinu"]