forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
199 lines (166 loc) · 5.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
FROM ubuntu:18.04
### SYSTEM DEPENDENCIES
ENV DEBIAN_FRONTEND="noninteractive" \
LC_ALL="en_US.UTF-8" \
LANG="en_US.UTF-8"
# Everything from `make` onwards in apt-get install is only installed to ensure
# Python support works with all packages (which may require specific libraries
# at install time).
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y --no-install-recommends \
build-essential \
dirmngr \
git \
bzr \
mercurial \
gnupg2 \
curl \
wget \
file \
zlib1g-dev \
liblzma-dev \
tzdata \
zip \
unzip \
locales \
openssh-client \
make \
libpq-dev \
libssl-dev \
libbz2-dev \
libffi-dev \
libreadline-dev \
libsqlite3-dev \
libcurl4-openssl-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
libmysqlclient-dev \
xz-utils \
tk-dev \
libxml2-dev \
libxmlsec1-dev \
libgeos-dev \
python3-enchant \
&& locale-gen en_US.UTF-8
### RUBY
# Install Ruby 2.6.6, update RubyGems, and install Bundler
ENV BUNDLE_SILENCE_ROOT_WARNING=1
RUN apt-get install -y software-properties-common \
&& apt-add-repository ppa:brightbox/ruby-ng \
&& apt-get update \
&& apt-get install -y ruby2.6 ruby2.6-dev \
&& gem update --system 3.0.3 \
&& gem install bundler -v 1.17.3 --no-document
### PYTHON
# Install Python 2.7 and 3.9 with pyenv. Using pyenv lets us support multiple Pythons
ENV PYENV_ROOT=/usr/local/.pyenv \
PATH="/usr/local/.pyenv/bin:$PATH"
RUN git clone https://github.com/pyenv/pyenv.git /usr/local/.pyenv \
&& cd /usr/local/.pyenv && git checkout v1.2.21 && cd - \
&& pyenv install 3.9.0 \
&& pyenv install 2.7.18 \
&& pyenv global 3.9.0
### JAVASCRIPT
# Install Node 10.0 and Yarn
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install -y nodejs \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install -y yarn
### ELM
# Install Elm 0.18 and Elm 0.19
ENV PATH="$PATH:/node_modules/.bin"
RUN npm install [email protected] \
&& wget "https://github.com/elm/compiler/releases/download/0.19.0/binaries-for-linux.tar.gz" \
&& tar xzf binaries-for-linux.tar.gz \
&& mv elm /usr/local/bin/elm19 \
&& rm -f binaries-for-linux.tar.gz \
&& rm -rf ~/.npm
### PHP
# Install PHP 7.4 and Composer
ENV COMPOSER_ALLOW_SUPERUSER=1
COPY --from=composer:1.10.9 /usr/bin/composer /usr/local/bin/composer
RUN add-apt-repository ppa:ondrej/php \
&& apt-get update \
&& apt-get install -y \
php7.4 \
php7.4-apcu \
php7.4-bcmath \
php7.4-cli \
php7.4-common \
php7.4-curl \
php7.4-gd \
php7.4-geoip \
php7.4-gettext \
php7.4-gmp \
php7.4-imagick \
php7.4-imap \
php7.4-intl \
php7.4-json \
php7.4-ldap \
php7.4-mbstring \
php7.4-memcached \
php7.4-mongodb \
php7.4-mysql \
php7.4-redis \
php7.4-soap \
php7.4-sqlite3 \
php7.4-tidy \
php7.4-xml \
php7.4-zip \
php7.4-zmq
### GO
# Install Go and dep
ARG GOLANG_VERSION=1.15.2
ARG GOLANG_CHECKSUM=b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552
RUN curl -o go.tar.gz https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz \
&& echo "$GOLANG_CHECKSUM go.tar.gz" | sha256sum -c - \
&& tar -xzf go.tar.gz -C /opt \
&& mkdir /opt/go/gopath \
&& wget -O /opt/go/bin/dep https://github.com/golang/dep/releases/download/v0.5.4/dep-linux-amd64 \
&& chmod +x /opt/go/bin/dep \
&& rm go.tar.gz
ENV PATH=/opt/go/bin:$PATH GOPATH=/opt/go/gopath
### ELIXIR
# Install Erlang, Elixir and Hex
ENV PATH="$PATH:/usr/local/elixir/bin"
# https://github.com/elixir-lang/elixir/releases
ARG ELIXIR_VERSION=v1.10.4
ARG ELIXIR_CHECKSUM=9727ae96d187d8b64e471ff0bb5694fcd1009cdcfd8b91a6b78b7542bb71fca59869d8440bb66a2523a6fec025f1d23394e7578674b942274c52b44e19ba2d43
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \
&& dpkg -i erlang-solutions_1.0_all.deb \
&& apt-get update \
&& apt-get install -y esl-erlang \
&& wget https://github.com/elixir-lang/elixir/releases/download/${ELIXIR_VERSION}/Precompiled.zip \
&& echo "$ELIXIR_CHECKSUM Precompiled.zip" | sha512sum -c - \
&& unzip -d /usr/local/elixir -x Precompiled.zip \
&& rm -f Precompiled.zip erlang-solutions_1.0_all.deb \
&& mix local.hex --force
### RUST
# Install Rust 1.47.0
ENV RUSTUP_HOME=/opt/rust \
PATH="${PATH}:/opt/rust/bin"
RUN export CARGO_HOME=/opt/rust ; curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN export CARGO_HOME=/opt/rust ; rustup toolchain install 1.47.0 && rustup default 1.47.0
### NEW NATIVE HELPERS
COPY composer/helpers /opt/composer/helpers
COPY dep/helpers /opt/dep/helpers
COPY bundler/helpers /opt/bundler/helpers
COPY go_modules/helpers /opt/go_modules/helpers
COPY hex/helpers /opt/hex/helpers
COPY npm_and_yarn/helpers /opt/npm_and_yarn/helpers
COPY python/helpers /opt/python/helpers
COPY terraform/helpers /opt/terraform/helpers
ENV DEPENDABOT_NATIVE_HELPERS_PATH="/opt" \
PATH="$PATH:/opt/terraform/bin:/opt/python/bin:/opt/go_modules/bin:/opt/dep/bin" \
MIX_HOME="/opt/hex/mix"
RUN bash /opt/terraform/helpers/build /opt/terraform && \
bash /opt/python/helpers/build /opt/python && \
bash /opt/dep/helpers/build /opt/dep && \
bash /opt/bundler/helpers/build /opt/bundler && \
bash /opt/go_modules/helpers/build /opt/go_modules && \
bash /opt/npm_and_yarn/helpers/build /opt/npm_and_yarn && \
bash /opt/hex/helpers/build /opt/hex && \
bash /opt/composer/helpers/build /opt/composer