Skip to content

Commit

Permalink
feat: add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
renyijiu committed Jul 5, 2020
1 parent 37e0061 commit 6e2b00d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM alpine:latest

ARG VIPS_VERSION=8.9.1
ARG VIPS_URL=https://github.com/libvips/libvips/releases/download

RUN apk update && apk upgrade

# basic packages libvips likes
RUN apk add \
build-base \
autoconf \
automake \
libtool \
bc \
zlib-dev \
expat-dev \
jpeg-dev \
tiff-dev \
glib-dev \
libjpeg-turbo-dev \
libexif-dev \
lcms2-dev \
fftw-dev \
giflib-dev \
libpng-dev \
libwebp-dev \
orc-dev \
libgsf-dev

# text rendering ... we have to download some fonts and rebuild the font
# cache
RUN apk add \
pango-dev \
msttcorefonts-installer \
wqy-zenhei --update-cache --repository http://nl.alpinelinux.org/alpine/edge/testing --allow-untrusted
RUN update-ms-fonts \
&& fc-cache -f

# there are other optional deps you can add for openslide / openexr /
# imagmagick support / Matlab support etc etc

# installing to /usr is not the best idea, but it's easy
RUN wget -O- ${VIPS_URL}/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp
RUN cd /tmp/vips-${VIPS_VERSION} \
&& ./configure --prefix=/usr --disable-static --disable-debug \
&& make V=0 \
&& make install

RUN apk add ruby-dev
RUN rm -rf /var/cache/apk/*
RUN gem install bundler && gem install json && gem install daily_image
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ Common options:

```

### docker

打包镜像

```shell
$ docker build . -t ruby-image

```

使用

```shell
$ docker run -it --mount src="$(pwd)",target=/home,type=bind ruby-image daily_image -s /home/
```

然后你就可以在当前目录看到新生成的图片文件了

## 示例

![](./tmp/daily_2018-10-06.jpeg)
Expand Down

0 comments on commit 6e2b00d

Please sign in to comment.