Browse Source

Update Dockerfile

new-scoring
aeris 1 month ago
parent
commit
39a6208970
2 changed files with 27 additions and 24 deletions
  1. 22
    22
      Dockerfile
  2. 5
    2
      Makefile

+ 22
- 22
Dockerfile View File

@@ -1,42 +1,42 @@
FROM alpine:3.7 AS builder
FROM alpine:3.10 AS builder
MAINTAINER aeris <aeris@imirhil.fr>

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 LD_LIBRARY_PATH /usr/local/ssl/lib
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 C_INCLUDE_PATH /cryptcheck/build/openssl/include
ENV CPLUS_INCLUDE_PATH /cryptcheck/build/openssl/include
ENV LIBRARY_PATH /cryptcheck/lib
ENV LD_LIBRARY_PATH /cryptcheck/lib

RUN git clone https://github.com/rbenv/rbenv "$RBENV_ROOT" -b v1.1.2 --depth 1
RUN git clone https://github.com/sstephenson/ruby-build "$RBENV_ROOT/plugins/ruby-build"

WORKDIR /cryptcheck/
COPY . /cryptcheck/

RUN make install-openssl
RUN PATH=/usr/local/ssl/bin:$PATH \
LIBRARY_PATH=$LD_LIBRARY_PATH \
C_INCLUDE_PATH=/usr/local/ssl/include \
ac_cv_func_isnan=yes ac_cv_func_isinf=yes \
make install-ruby && \
make mr-proper
RUN make libs
RUN make rbenv
RUN echo "gem: --no-test --no-document" > /etc/gemrc && \
gem install bundler && \
bundle install --deployment --without development test

FROM alpine:3.7 AS engine
FROM alpine:3.10 AS engine
MAINTAINER aeris <aeris@imirhil.fr>

WORKDIR /cryptcheck/
RUN apk add --update bash ca-certificates libxml2 yaml zlib libffi gdbm ncurses
ENV LD_LIBRARY_PATH /usr/local/ssl/lib/
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

ENTRYPOINT ["/sbin/tini", "--", "/cryptcheck/bin/cryptcheck"]

COPY --from=builder /etc/gemrc /etc/gemrc
COPY --from=builder /usr/local/ssl/ /usr/local/ssl/
COPY --from=builder /usr/local/include/ruby-2.3.0/ /usr/local/include/ruby-2.3.0/
COPY --from=builder /usr/local/bin/bundle \
/usr/local/bin/bundler\
/usr/local/bin/gem \
/usr/local/bin/rake \
/usr/local/bin/ruby \
/usr/local/bin/
COPY --from=builder /usr/local/lib/libruby* /usr/local/lib/
COPY --from=builder /usr/local/lib/ruby/ /usr/local/lib/ruby/
COPY --from=builder /usr/local/rbenv/ /usr/local/rbenv/
COPY --from=builder /cryptcheck/ /cryptcheck/


+ 5
- 2
Makefile View File

@@ -29,10 +29,10 @@ build/:
mkdir "$@"

build/chacha-poly.patch: | build/
wget https://github.com/cloudflare/sslconfig/raw/master/patches/openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch -O "$@"
wget -q https://github.com/cloudflare/sslconfig/raw/master/patches/openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch -O "$@"

build/$(OPENSSL_NAME).tar.gz: | build/
wget "https://www.openssl.org/source/$(OPENSSL_NAME).tar.gz" -O "$@"
wget -q "https://www.openssl.org/source/$(OPENSSL_NAME).tar.gz" -O "$@"

build/openssl/: | $(OPENSSL_DIR)/
ln -s "$(OPENSSL_NAME)" "build/openssl"
@@ -88,3 +88,6 @@ test-material:

test: spec/faketime/libfaketime.so
bin/rspec

docker:
docker build . -t aeris22/cryptcheck:v2 -t aeris22/cryptcheck:v2.1 -t aeris22/cryptcheck:latest

Loading…
Cancel
Save