You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.6KB

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