blob: 0d7ad2175e3537b158461cb153a70a071750db10 [file] [log] [blame]
Roger Meier86446172015-12-06 16:27:35 +01001# 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 Meierbbaf9282015-12-25 12:34:43 +010021# Usage:
22# docker run -v "${PWD}:/data" thrift/thrift-compiler -gen cpp -o /data/ /data/test/ThriftTest.thrift
23#
Roger Meier86446172015-12-06 16:27:35 +010024# further details on docker for thrift is here build/docker/
25#
26# TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler
27
28FROM debian:jessie
29MAINTAINER Apache Thrift <dev@thrift.apache.org>
30
31ENV DEBIAN_FRONTEND noninteractive
32
Roger Meier86446172015-12-06 16:27:35 +010033ADD . /thrift
34
Roger Meierbbaf9282015-12-25 12:34:43 +010035RUN 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 \
taozlec0d384a2017-07-17 18:40:42 +020053 && curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
Roger Meierbbaf9282015-12-25 12:34:43 +010054 && 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 Meier86446172015-12-06 16:27:35 +010060
Roger Meierbbaf9282015-12-25 12:34:43 +010061ENTRYPOINT ["thrift"]