-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
49 lines (40 loc) · 1.64 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM alpine:3.11 AS builder
MAINTAINER aeris <aeris@imirhil.fr>
ARG OPENSSL_VERSION=1.0.2j
ARG OPENSSL_BINDING=1.0
ARG OPENSSL_LIB_VERSION=1.0.0
ARG RUBY_VERSION=2.3.8-cryptcheck
RUN apk add --update make gcc \
linux-headers readline-dev libxml2-dev yaml-dev zlib-dev libffi-dev gdbm-dev ncurses-dev \
ca-certificates wget patch perl musl-dev bash coreutils git
ENV PATH /usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH
ENV RBENV_ROOT /usr/local/rbenv
ENV RUBY_CONFIGURE_OPTS --disable-install-doc
ENV LD_LIBRARY_PATH /cryptcheck/lib
WORKDIR /cryptcheck/
COPY . /cryptcheck/
RUN make openssl-$OPENSSL_BINDING rbenv ruby-$OPENSSL_BINDING && \
cp build/openssl-$OPENSSL_VERSION/libssl.so \
build/openssl-$OPENSSL_VERSION/libssl.so.$OPENSSL_LIB_VERSION \
build/openssl-$OPENSSL_VERSION/libcrypto.so \
build/openssl-$OPENSSL_VERSION/libcrypto.so.$OPENSSL_LIB_VERSION \
lib && \
make clean
RUN echo "gem: --no-test --no-document" > /root/.gemrc && \
rbenv local $RUBY_VERSION && \
gem install bundler && \
rm -f Gemfile.lock && bundle update && \
bundle config set deployment true && \
bundle config set without 'development test' && \
bundle install
FROM alpine:3.11 AS engine
MAINTAINER aeris <aeris@imirhil.fr>
WORKDIR /cryptcheck/
RUN apk add --update tini bash ca-certificates libxml2 yaml zlib libffi gdbm ncurses
ENV PATH /usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH
ENV LD_LIBRARY_PATH /cryptcheck/lib
ENV RBENV_ROOT /usr/local/rbenv
ENTRYPOINT ["/sbin/tini", "--", "/cryptcheck/bin/cryptcheck"]
COPY --from=builder /root/.gemrc /root/.gemrc
COPY --from=builder /usr/local/rbenv/ /usr/local/rbenv/
COPY --from=builder /cryptcheck/ /cryptcheck/