mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
THRIFT-3474 Docker: thrift-compiler
some tuning suggested by Aki Sukegawa This closes #768
This commit is contained in:
parent
c91bd74934
commit
bbaf92837f
46
Dockerfile
46
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 <dev@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
|
||||
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/*
|
||||
|
||||
# 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"]
|
||||
ENTRYPOINT ["thrift"]
|
||||
|
Loading…
Reference in New Issue
Block a user