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