You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2016/01/07 20:35:39 UTC
thrift git commit: THRIFT-3474 Docker: thrift-compiler
Repository: thrift
Updated Branches:
refs/heads/master c91bd7493 -> bbaf92837
THRIFT-3474 Docker: thrift-compiler
some tuning suggested by Aki Sukegawa
This closes #768
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/bbaf9283
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/bbaf9283
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/bbaf9283
Branch: refs/heads/master
Commit: bbaf92837fa836c65acc4a0f874ef05e8129dc18
Parents: c91bd74
Author: Roger Meier <ro...@apache.org>
Authored: Fri Dec 25 12:34:43 2015 +0100
Committer: Roger Meier <ro...@apache.org>
Committed: Thu Jan 7 20:35:02 2016 +0100
----------------------------------------------------------------------
Dockerfile | 48 ++++++++++++++++++++++++++++++------------------
1 file changed, 30 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/bbaf9283/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index b5742e9..0d7ad21 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,6 +18,9 @@
# Goal: provide a thrift-compiler Docker image
#
+# Usage:
+# docker run -v "${PWD}:/data" thrift/thrift-compiler -gen cpp -o /data/ /data/test/ThriftTest.thrift
+#
# further details on docker for thrift is here build/docker/
#
# TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler
@@ -27,23 +30,32 @@ MAINTAINER Apache Thrift <de...@thrift.apache.org>
ENV DEBIAN_FRONTEND noninteractive
-RUN apt-get update
-RUN apt-get upgrade -y
-
-# minimal dependencies
-RUN apt-get install -y flex bison g++ cmake
-
ADD . /thrift
-RUN mkdir cmake-build && cd cmake-build && cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF /thrift && make
-RUN cp /cmake-build/bin/thrift /usr/bin/thrift
-
-# Clean up
-RUN apt-get clean && \
- rm -rf /var/cache/apt/* && \
- rm -rf /var/lib/apt/lists/* && \
- rm -rf /tmp/* && \
- rm -rf /var/tmp/* \
- rm -rf cmake-build
-
-ENTRYPOINT ["/usr/bin/thrift"]
+RUN buildDeps=" \
+ flex \
+ bison \
+ g++ \
+ make \
+ cmake \
+ curl \
+ "; \
+ apt-get update && apt-get install -y --no-install-recommends $buildDeps \
+ && mkdir /tmp/cmake-build && cd /tmp/cmake-build \
+ && cmake \
+ -DBUILD_COMPILER=ON \
+ -DBUILD_LIBRARIES=OFF \
+ -DBUILD_TESTING=OFF \
+ -DBUILD_EXAMPLES=OFF \
+ /thrift \
+ && cmake --build . --config Release \
+ && make install \
+ && curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
+ && tar xzf /tmp/go.tar.gz -C /tmp \
+ && cp /tmp/go/bin/gofmt /usr/bin/gofmt \
+ && apt-get purge -y --auto-remove $buildDeps \
+ && apt-get clean \
+ && rm -rf /tmp/* \
+ && rm -rf /var/lib/apt/lists/*
+
+ENTRYPOINT ["thrift"]