Skip to content

Commit

Permalink
Add OpenSSL build support in Dockerfile (#360)
Browse files Browse the repository at this point in the history
* Add OpenSSL build support in Dockerfile

* add ~/.openssl to Travis cache

* add git requirement to Dockerfile

* finalize Dockerfile
  • Loading branch information
vaivaswatha authored Jan 8, 2019
1 parent d352f4c commit 4e5187c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ addons:
cache:
directories:
- $HOME/.opam
- $HOME/openssl
sudo: required
branches:
only:
Expand Down
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ RUN apt-get update \
libboost-system-dev \
&& rm -rf /var/lib/apt/lists/*

RUN make opamdep && echo \
". ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true " >> ~/.bashrc && \
eval `opam config env` && make
ARG OPENSSL_INSTALL_DIR=/opt/openssl
ENV CPLUS_INCLUDE_PATH=${OPENSSL_INSTALL_DIR}/include
ENV LIBRARY_PATH=${OPENSSL_INSTALL_DIR}/lib
ENV LD_LIBRARY_PATH=${OPENSSL_INSTALL_DIR}/lib

RUN cd ${HOME} \
&& curl -LO https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gz \
&& tar zxvf OpenSSL_1_1_1a.tar.gz && cd openssl-OpenSSL_1_1_1a \
&& ./config --prefix=${OPENSSL_INSTALL_DIR} --openssldir=${OPENSSL_INSTALL_DIR} \
&& make -j$(nproc) && make install && cd ${HOME} \
&& rm -rf OpenSSL_1_1_1a.tar.gz openssl-OpenSSL_1_1_1a

RUN cd /scilla && make opamdep \
&& echo '. ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true ' >> ~/.bashrc \
&& eval `opam config env` && \
make
19 changes: 16 additions & 3 deletions Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ RUN apt-get update \
libboost-system-dev \
&& rm -rf /var/lib/apt/lists/*

RUN make opamdep && echo \
". ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true " >> ~/.bashrc && \
eval `opam config env` && make slim
ARG OPENSSL_INSTALL_DIR=/opt/openssl
ENV CPLUS_INCLUDE_PATH=${OPENSSL_INSTALL_DIR}/include
ENV LIBRARY_PATH=${OPENSSL_INSTALL_DIR}/lib
ENV LD_LIBRARY_PATH=${OPENSSL_INSTALL_DIR}/lib

RUN cd ${HOME} \
&& curl -LO https://github.com/openssl/openssl/archive/OpenSSL_1_1_1a.tar.gz \
&& tar zxvf OpenSSL_1_1_1a.tar.gz && cd openssl-OpenSSL_1_1_1a \
&& ./config --prefix=${OPENSSL_INSTALL_DIR} --openssldir=${OPENSSL_INSTALL_DIR} \
&& make -j$(nproc) && make install && cd ${HOME} \
&& rm -rf OpenSSL_1_1_1a.tar.gz openssl-OpenSSL_1_1_1a

RUN cd /scilla && make opamdep \
&& echo '. ~/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true ' >> ~/.bashrc \
&& eval `opam config env` && \
make slim

0 comments on commit 4e5187c

Please sign in to comment.