From 2acb1fc9750c0f5f6676f7b94f409e457b96c3f8 Mon Sep 17 00:00:00 2001
From: William Woodruff <william.woodruff@trailofbits.com>
Date: Fri, 6 Dec 2019 13:36:08 -0500
Subject: [PATCH] Dockerfile: Dockerize pe-parse (#102)

Adds a default entrypoint for the dump-pe as well.
---
 Dockerfile | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Dockerfile

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..3db0ff5
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+FROM alpine:latest
+ARG BUILD_TYPE=Release
+
+LABEL name "pe-parse"
+LABEL src "https://github.com/trailofbits/pe-parse"
+LABEL creator "Trail of Bits"
+LABEL dockerfile_maintenance "William Woodruff <william@trailofbits>"
+LABEL desc "Principled, lightweight C/C++ PE parser"
+
+RUN apk add --no-cache cmake icu-dev build-base
+
+COPY . /app/pe-parse
+WORKDIR /app/pe-parse
+RUN mkdir build && \
+    cd build && \
+    cmake -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. && \
+    cmake --build . --config "${BUILD_TYPE}" && \
+    cmake --build . --config "${BUILD_TYPE}" --target install
+
+ENTRYPOINT [ "/usr/bin/dump-pe" ]
+CMD ["--help"]