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 \ |
James E. King, III | 7d211b8 | 2017-09-06 10:12:02 -0700 | [diff] [blame] | 59 | valgrind \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 60 | vim |
| 61 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 62 | |
| 63 | ### languages |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 64 | |
| 65 | RUN apt-get install -y --no-install-recommends \ |
| 66 | `# C++ dependencies` \ |
| 67 | libboost-dev \ |
| 68 | libboost-filesystem-dev \ |
| 69 | libboost-program-options-dev \ |
| 70 | libboost-system-dev \ |
| 71 | libboost-test-dev \ |
| 72 | libboost-thread-dev \ |
| 73 | libevent-dev \ |
| 74 | libssl-dev \ |
| 75 | qt5-default \ |
| 76 | qtbase5-dev \ |
| 77 | qtbase5-dev-tools |
| 78 | |
| 79 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 80 | `# D dependencies` \ |
| 81 | dmd-bin \ |
| 82 | libevent-dev \ |
| 83 | libssl-dev \ |
| 84 | xdg-utils |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 85 | # libevent deimos disabled - build errors |
| 86 | # RUN mkdir -p /usr/include/dmd/druntime/import/deimos /usr/include/dmd/druntime/import/C && \ |
| 87 | # curl -sSL https://github.com/D-Programming-Deimos/libevent/archive/master.tar.gz| tar xz && \ |
| 88 | # mv libevent-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 89 | # mv libevent-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 90 | # rm -rf libevent-master |
| 91 | # openssl deimos doesn't work with openssl-1.1.0 - disabling it for now: |
| 92 | # RUN curl -sSL https://github.com/D-Programming-Deimos/openssl/archive/master.tar.gz| tar xz && \ |
| 93 | # mv openssl-master/deimos/* /usr/include/dmd/druntime/import/deimos/ && \ |
| 94 | # mv openssl-master/C/* /usr/include/dmd/druntime/import/C/ && \ |
| 95 | # rm -rf openssl-master |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 96 | |
| 97 | RUN apt-get install -y --no-install-recommends \ |
| 98 | `# Dart dependencies` \ |
| 99 | dart |
| 100 | ENV PATH /usr/lib/dart/bin:$PATH |
| 101 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 102 | # project isn't ready for this quite yet: |
| 103 | # RUN apt-get install -y --no-install-recommends \ |
| 104 | # `# dotnet core dependencies` \ |
Jens Geyer | 526a1ac | 2021-02-13 13:58:09 +0100 | [diff] [blame] | 105 | # dotnet-sdk-5.0 |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 106 | |
| 107 | RUN apt-get install -y --no-install-recommends \ |
| 108 | `# Erlang dependencies` \ |
| 109 | erlang-base \ |
| 110 | erlang-eunit \ |
| 111 | erlang-dev \ |
| 112 | erlang-tools \ |
| 113 | rebar |
| 114 | |
| 115 | RUN apt-get install -y --no-install-recommends \ |
| 116 | `# GlibC dependencies` \ |
| 117 | libglib2.0-dev |
| 118 | |
| 119 | RUN apt-get install -y --no-install-recommends \ |
| 120 | `# golang (go) dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 121 | golang-go |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 122 | |
| 123 | RUN apt-get install -y --no-install-recommends \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 124 | `# Haxe dependencies` \ |
| 125 | haxe \ |
| 126 | neko \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 127 | neko-dev |
| 128 | RUN haxelib setup --always /usr/share/haxe/lib && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 129 | haxelib install --always hxcpp |
| 130 | |
| 131 | RUN apt-get install -y --no-install-recommends \ |
| 132 | `# Java dependencies` \ |
| 133 | ant \ |
| 134 | ant-optional \ |
| 135 | openjdk-8-jdk \ |
| 136 | maven |
| 137 | |
| 138 | RUN apt-get install -y --no-install-recommends \ |
| 139 | `# Lua dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 140 | lua5.2 \ |
| 141 | lua5.2-dev |
| 142 | # https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212 |
| 143 | # same for debian stretch |
| 144 | # 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] | 145 | |
| 146 | RUN apt-get install -y --no-install-recommends \ |
| 147 | `# Node.js dependencies` \ |
| 148 | nodejs |
| 149 | |
| 150 | RUN apt-get install -y --no-install-recommends \ |
| 151 | `# OCaml dependencies` \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 152 | ocaml \ |
| 153 | opam && \ |
| 154 | opam init --yes && \ |
| 155 | opam install --yes oasis |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 156 | |
| 157 | RUN apt-get install -y --no-install-recommends \ |
| 158 | `# Perl dependencies` \ |
| 159 | libbit-vector-perl \ |
| 160 | libclass-accessor-class-perl \ |
| 161 | libcrypt-ssleay-perl \ |
| 162 | libio-socket-ssl-perl \ |
| 163 | libnet-ssleay-perl |
| 164 | |
| 165 | RUN apt-get install -y --no-install-recommends \ |
| 166 | `# Php dependencies` \ |
| 167 | php7.0 \ |
| 168 | php7.0-cli \ |
| 169 | php7.0-dev \ |
| 170 | php-pear \ |
| 171 | re2c \ |
| 172 | phpunit |
| 173 | |
| 174 | RUN apt-get install -y --no-install-recommends \ |
| 175 | `# Python dependencies` \ |
| 176 | python-all \ |
| 177 | python-all-dbg \ |
| 178 | python-all-dev \ |
| 179 | python-backports.ssl-match-hostname \ |
| 180 | python-ipaddress \ |
| 181 | python-pip \ |
| 182 | python-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 183 | python-six \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 184 | python-tornado \ |
| 185 | python-twisted \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 186 | python-wheel \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 187 | python-zope.interface \ |
| 188 | python3-all \ |
| 189 | python3-all-dbg \ |
| 190 | python3-all-dev \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 191 | python3-setuptools \ |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 192 | python3-six \ |
| 193 | python3-tornado \ |
| 194 | python3-twisted \ |
| 195 | python3-wheel \ |
| 196 | python3-zope.interface && \ |
| 197 | pip install --upgrade backports.ssl_match_hostname |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 198 | |
| 199 | RUN apt-get install -y --no-install-recommends \ |
| 200 | `# Ruby dependencies` \ |
| 201 | ruby \ |
| 202 | ruby-dev \ |
| 203 | ruby-bundler |
| 204 | RUN gem install bundler --no-ri --no-rdoc |
| 205 | |
| 206 | RUN apt-get install -y --no-install-recommends \ |
| 207 | `# Rust dependencies` \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 208 | rustc |
| 209 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 210 | # Update anything else left hanging |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 211 | RUN apt-get dist-upgrade -y |
| 212 | |
James E. King, III | d7142b7 | 2017-09-01 13:00:36 -0700 | [diff] [blame] | 213 | # Clean up |
| 214 | RUN rm -rf /var/cache/apt/* && \ |
James E. King, III | b66b66f | 2017-08-31 18:07:40 -0700 | [diff] [blame] | 215 | rm -rf /var/lib/apt/lists/* && \ |
| 216 | rm -rf /tmp/* && \ |
| 217 | rm -rf /var/tmp/* |
| 218 | |
| 219 | ENV THRIFT_ROOT /thrift |
| 220 | RUN mkdir -p $THRIFT_ROOT/src |
| 221 | COPY Dockerfile $THRIFT_ROOT/ |
| 222 | WORKDIR $THRIFT_ROOT/src |