Roger Meier | 8644617 | 2015-12-06 16:27:35 +0100 | [diff] [blame] | 1 | # Licensed to the Apache Software Foundation (ASF) under one |
| 2 | # or more contributor license agreements. See the NOTICE file |
| 3 | # distributed with this work for additional information |
| 4 | # regarding copyright ownership. The ASF licenses this file |
| 5 | # to you under the Apache License, Version 2.0 (the |
| 6 | # "License"); you may not use this file except in compliance |
| 7 | # with the License. You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, |
| 12 | # software distributed under the License is distributed on an |
| 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | # KIND, either express or implied. See the License for the |
| 15 | # specific language governing permissions and limitations |
| 16 | # under the License. |
| 17 | # |
| 18 | |
| 19 | # Goal: provide a thrift-compiler Docker image |
| 20 | # |
Roger Meier | bbaf928 | 2015-12-25 12:34:43 +0100 | [diff] [blame] | 21 | # Usage: |
| 22 | # docker run -v "${PWD}:/data" thrift/thrift-compiler -gen cpp -o /data/ /data/test/ThriftTest.thrift |
| 23 | # |
Roger Meier | 8644617 | 2015-12-06 16:27:35 +0100 | [diff] [blame] | 24 | # further details on docker for thrift is here build/docker/ |
| 25 | # |
| 26 | # TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler |
| 27 | |
| 28 | FROM debian:jessie |
| 29 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
| 30 | |
| 31 | ENV DEBIAN_FRONTEND noninteractive |
| 32 | |
Roger Meier | 8644617 | 2015-12-06 16:27:35 +0100 | [diff] [blame] | 33 | ADD . /thrift |
| 34 | |
Roger Meier | bbaf928 | 2015-12-25 12:34:43 +0100 | [diff] [blame] | 35 | RUN buildDeps=" \ |
| 36 | flex \ |
| 37 | bison \ |
| 38 | g++ \ |
| 39 | make \ |
| 40 | cmake \ |
| 41 | curl \ |
| 42 | "; \ |
| 43 | apt-get update && apt-get install -y --no-install-recommends $buildDeps \ |
| 44 | && mkdir /tmp/cmake-build && cd /tmp/cmake-build \ |
| 45 | && cmake \ |
| 46 | -DBUILD_COMPILER=ON \ |
| 47 | -DBUILD_LIBRARIES=OFF \ |
| 48 | -DBUILD_TESTING=OFF \ |
| 49 | -DBUILD_EXAMPLES=OFF \ |
| 50 | /thrift \ |
| 51 | && cmake --build . --config Release \ |
| 52 | && make install \ |
| 53 | && curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \ |
| 54 | && tar xzf /tmp/go.tar.gz -C /tmp \ |
| 55 | && cp /tmp/go/bin/gofmt /usr/bin/gofmt \ |
| 56 | && apt-get purge -y --auto-remove $buildDeps \ |
| 57 | && apt-get clean \ |
| 58 | && rm -rf /tmp/* \ |
| 59 | && rm -rf /var/lib/apt/lists/* |
Roger Meier | 8644617 | 2015-12-06 16:27:35 +0100 | [diff] [blame] | 60 | |
Roger Meier | bbaf928 | 2015-12-25 12:34:43 +0100 | [diff] [blame] | 61 | ENTRYPOINT ["thrift"] |