Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # Goal: provide a thrift-compiler Docker image
  19. #
  20. # Usage:
  21. # docker run -v "${PWD}:/data" thrift/thrift-compiler -gen cpp -o /data/ /data/test/ThriftTest.thrift
  22. #
  23. # further details on docker for thrift is here build/docker/
  24. #
  25. # TODO: push to apache/thrift-compiler instead of thrift/thrift-compiler
  26. FROM debian:jessie
  27. MAINTAINER Apache Thrift <dev@thrift.apache.org>
  28. ENV DEBIAN_FRONTEND noninteractive
  29. ADD . /thrift
  30. RUN buildDeps=" \
  31. flex \
  32. bison \
  33. g++ \
  34. make \
  35. cmake \
  36. curl \
  37. "; \
  38. apt-get update && apt-get install -y --no-install-recommends $buildDeps \
  39. && mkdir /tmp/cmake-build && cd /tmp/cmake-build \
  40. && cmake \
  41. -DBUILD_COMPILER=ON \
  42. -DBUILD_LIBRARIES=OFF \
  43. -DBUILD_TESTING=OFF \
  44. -DBUILD_EXAMPLES=OFF \
  45. /thrift \
  46. && cmake --build . --config Release \
  47. && make install \
  48. && curl -k -sSL "https://storage.googleapis.com/golang/go1.5.2.linux-amd64.tar.gz" -o /tmp/go.tar.gz \
  49. && tar xzf /tmp/go.tar.gz -C /tmp \
  50. && cp /tmp/go/bin/gofmt /usr/bin/gofmt \
  51. && apt-get purge -y --auto-remove $buildDeps \
  52. && apt-get clean \
  53. && rm -rf /tmp/* \
  54. && rm -rf /var/lib/apt/lists/*
  55. ENTRYPOINT ["thrift"]