James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 1 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 2 | # you may not use this file except in compliance with the License. |
| 3 | # You may obtain a copy of the License at |
| 4 | # |
| 5 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | # |
| 7 | # Unless required by applicable law or agreed to in writing, software |
| 8 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 10 | # See the License for the specific language governing permissions and |
| 11 | # limitations under the License. |
| 12 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 13 | # Apache Thrift Docker build environment for Debian Stretch |
| 14 | # |
| 15 | # Known issues: |
| 16 | # - d: deimos for libevent and openssl disabled - build errors |
| 17 | # - dotnetcore, because netcore is for 1.0.0-preview and 2.0.0 is out |
| 18 | # - rust: cargo not in debian repo - perhaps not needed? |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 19 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 20 | FROM buildpack-deps:stretch-scm |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 21 | MAINTAINER Apache Thrift <dev@thrift.apache.org> |
| 22 | |
| 23 | ENV DEBIAN_FRONTEND noninteractive |
| 24 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 25 | ### Add apt repos |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 26 | |
| 27 | RUN apt-get update && apt-get install -y --no-install-recommends apt apt-transport-https curl wget apt-utils |
| 28 | |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 29 | # D |
| 30 | RUN wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list && \ |
| 31 | apt-get update && apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring |
| 32 | |
| 33 | # Dart |
| 34 | RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 35 | curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list && \ |
| 36 | sed -i /etc/apt/sources.list.d/dart_stable.list -e 's/https:/http:/g' |
| 37 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 38 | # dotnet (core) 2.0.0 - project isn't ready for this yet: |
| 39 | # RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg && \ |
| 40 | # echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 41 | |
| 42 | # node.js (this step runs apt-get update internally) |
| 43 | RUN curl -sL https://deb.nodesource.com/setup_8.x | bash |
| 44 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 45 | |
| 46 | ### install general dependencies |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 47 | RUN apt-get install -y --no-install-recommends \ |
| 48 | `# General dependencies` \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 49 | bash-completion \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 50 | bison \ |
| 51 | build-essential \ |
| 52 | clang \ |
| 53 | cmake \ |
| 54 | debhelper \ |
| 55 | flex \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 56 | gdb \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 57 | ninja-build \ |
| 58 | pkg-config \ |
| 59 | vim |
| 60 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 61 | |
| 62 | ### languages |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 63 | |
| 64 | RUN apt-get install -y --no-install-recommends \ |
| 65 | `# C++ dependencies` \ |
| 66 | libboost-dev \ |
| 67 | libboost-filesystem-dev \ |
| 68 | libboost-program-options-dev \ |
| 69 | libboost-system-dev \ |
| 70 | libboost-test-dev \ |
| 71 | libboost-thread-dev \ |
| 72 | libevent-dev \ |
| 73 | libssl-dev \ |
| 74 | qt5-default \ |
| 75 | qtbase5-dev \ |
| 76 | qtbase5-dev-tools |
| 77 | |
| 78 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | f454369 | 2017-09-01 05:23:29 -0700 | [diff] [blame] | 79 | `# csharp (mono) dependencies` \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 80 | mono-devel |
| 81 | |
| 82 | RUN apt-get install -y --no-install-recommends \ |
| 83 | `# D dependencies` \ |
| 84 | dmd-bin \ |
| 85 | libevent-dev \ |
| 86 | libssl-dev \ |
| 87 | xdg-utils |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 88 | # libevent deimos disabled - build errors |
| 89 | # RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 90 | # curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 91 | # mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 92 | # mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 93 | # rm -rf libevent-master |
| 94 | # openssl deimos doesn't work with openssl-1.1.0 - disabling it for now: |
| 95 | # RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
| 96 | # mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 97 | # mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 98 | # rm -rf openssl-master |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 99 | |
| 100 | RUN apt-get install -y --no-install-recommends \ |
| 101 | `# Dart dependencies` \ |
| 102 | dart |
| 103 | ENV PATH /usr/lib/dart/bin:$PATH |
| 104 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 105 | # project isn't ready for this quite yet: |
| 106 | # RUN apt-get install -y --no-install-recommends \ |
| 107 | # `# dotnet core dependencies` \ |
| 108 | # dotnet-sdk-2.0.0 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 109 | |
| 110 | RUN apt-get install -y --no-install-recommends \ |
| 111 | `# Erlang dependencies` \ |
| 112 | erlang-base \ |
| 113 | erlang-eunit \ |
| 114 | erlang-dev \ |
| 115 | erlang-tools \ |
| 116 | rebar |
| 117 | |
| 118 | RUN apt-get install -y --no-install-recommends \ |
| 119 | `# GlibC dependencies` \ |
| 120 | libglib2.0-dev |
| 121 | |
| 122 | RUN apt-get install -y --no-install-recommends \ |
| 123 | `# golang (go) dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 124 | golang-go |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 125 | |
| 126 | RUN apt-get install -y --no-install-recommends \ |
| 127 | `# Haskell dependencies` \ |
| 128 | ghc \ |
| 129 | cabal-install |
| 130 | |
| 131 | RUN apt-get install -y --no-install-recommends \ |
| 132 | `# Haxe dependencies` \ |
| 133 | haxe \ |
| 134 | neko \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 135 | neko-dev |
| 136 | RUN haxelib setup --always /usr/share/haxe/lib && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 137 | haxelib install --always hxcpp |
| 138 | |
| 139 | RUN apt-get install -y --no-install-recommends \ |
| 140 | `# Java dependencies` \ |
| 141 | ant \ |
| 142 | ant-optional \ |
| 143 | openjdk-8-jdk \ |
| 144 | maven |
| 145 | |
| 146 | RUN apt-get install -y --no-install-recommends \ |
| 147 | `# Lua dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 148 | lua5.2 \ |
| 149 | lua5.2-dev |
| 150 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 151 | # same for debian stretch |
| 152 | # lua5.3 does not install alternatives so stick with 5.2 here |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 153 | |
| 154 | RUN apt-get install -y --no-install-recommends \ |
| 155 | `# Node.js dependencies` \ |
| 156 | nodejs |
| 157 | |
| 158 | RUN apt-get install -y --no-install-recommends \ |
| 159 | `# OCaml dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 160 | ocaml \ |
| 161 | opam && \ |
| 162 | opam init --yes && \ |
| 163 | opam install --yes oasis |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 164 | |
| 165 | RUN apt-get install -y --no-install-recommends \ |
| 166 | `# Perl dependencies` \ |
| 167 | libbit-vector-perl \ |
| 168 | libclass-accessor-class-perl \ |
| 169 | libcrypt-ssleay-perl \ |
| 170 | libio-socket-ssl-perl \ |
| 171 | libnet-ssleay-perl |
| 172 | |
| 173 | RUN apt-get install -y --no-install-recommends \ |
| 174 | `# Php dependencies` \ |
| 175 | php7.0 \ |
| 176 | php7.0-cli \ |
| 177 | php7.0-dev \ |
| 178 | php-pear \ |
| 179 | re2c \ |
| 180 | phpunit |
| 181 | |
| 182 | RUN apt-get install -y --no-install-recommends \ |
| 183 | `# Python dependencies` \ |
| 184 | python-all \ |
| 185 | python-all-dbg \ |
| 186 | python-all-dev \ |
| 187 | python-backports.ssl-match-hostname \ |
| 188 | python-ipaddress \ |
| 189 | python-pip \ |
| 190 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 191 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 192 | python-tornado \ |
| 193 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 194 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 195 | python-zope.interface \ |
| 196 | python3-all \ |
| 197 | python3-all-dbg \ |
| 198 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 199 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 200 | python3-six \ |
| 201 | python3-tornado \ |
| 202 | python3-twisted \ |
| 203 | python3-wheel \ |
| 204 | python3-zope.interface && \ |
| 205 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 206 | |
| 207 | RUN apt-get install -y --no-install-recommends \ |
| 208 | `# Ruby dependencies` \ |
| 209 | ruby \ |
| 210 | ruby-dev \ |
| 211 | ruby-bundler |
| 212 | RUN gem install bundler --no-ri --no-rdoc |
| 213 | |
| 214 | RUN apt-get install -y --no-install-recommends \ |
| 215 | `# Rust dependencies` \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 216 | rustc |
| 217 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 218 | # Update anything else left hanging |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 219 | RUN apt-get dist-upgrade -y |
| 220 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame^] | 221 | # Clean up |
| 222 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 223 | rm -rf /var/lib/apt/lists/* && \ |
| 224 | rm -rf /tmp/* && \ |
| 225 | rm -rf /var/tmp/* |
| 226 | |
| 227 | ENV THRIFT_ROOT /thrift |
| 228 | RUN mkdir -p $THRIFT_ROOT/src |
| 229 | COPY Dockerfile $THRIFT_ROOT/ |
| 230 | WORKDIR $THRIFT_ROOT/src |