From 33f0d443ba9fbfc60878585ffa85a779487b7fca Mon Sep 17 00:00:00 2001 From: Bob Van Zant Date: Tue, 6 Sep 2016 09:50:22 -0700 Subject: [PATCH] Create a Dockerfile for containerizing examples This commit introduces a basic Dockerfile based on Ubuntu 16.04. The built container contains the result of make install along with required dependencies. The README was updated with usage instructions. --- Dockerfile | 16 ++++++++++++++++ README | 8 ++++++++ 2 files changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1f89211 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:16.04 + +RUN mkdir -p /src +WORKDIR /src +ADD . /src +# This is ugly, however, keeping it in one command cuts the resultant image +# size in half +RUN apt update && apt install -y openssl libssl-dev build-essential && \ + ./configure && \ + make install && \ + rm -rf /src && \ + apt remove --quiet -y libssl-dev build-essential && \ + apt autoremove -y && \ + apt clean -y && \ + apt autoclean -y && \ + rm -rf /var/lib/apt /tmp/* /var/tmp/* diff --git a/README b/README index 5193068..7b214c1 100644 --- a/README +++ b/README @@ -99,6 +99,14 @@ Android NDK: make make install +Docker +------ +A Dockerfile is included to make running the examples easy. You can build the container with: + docker build -t libest:latest . + +Once built, the example binaries are installed in /usr/local/est/bin. Run them like so: + + docker run libest:latest /usr/local/est/bin/estserver --help