-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.theia
More file actions
472 lines (431 loc) · 22.5 KB
/
Copy pathDockerfile.theia
File metadata and controls
472 lines (431 loc) · 22.5 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# syntax=docker/dockerfile:1
# Above line must be first, and is the recommended Dockerfile interpreter.
# @see https://docs.docker.com/build/dockerfile/frontend/#stable-channel
### ARG steps.
# These must be renewed in each stage.
ARG CURL="curl -sSLf"
ARG REPO_LOCATION
### Build base image.
# Only install critical dependencies common to later build stages.
# Anything installed here will end up in the final IDE image.
# Any updates or changes here will force all other stages to rebuild.
FROM ${REPO_LOCATION}acquia/ubuntu:22.04-slim AS base
# Only define build-critical environment variables here to avoid cache-busting.
# All other ENV vars go at the end of this file.
ENV DOCKER_ID=1000
ENV DOCKER_GID=50
ENV IDE_UID=10000
ENV IDE_GID=1002
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
ARG CURL
RUN apt-get update \
# @see https://github.com/phusion/passenger-docker#upgrading-the-operating-system-inside-the-container
&& apt-get upgrade -qqy -o Dpkg::Options::="--force-confold" \
&& apt-get install -qqy --no-install-recommends apt curl software-properties-common \
&& $CURL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -qqy --no-install-recommends nodejs build-essential pkg-config \
gawk automake bison libffi-dev libgdbm-dev libncurses5-dev \
libsqlite3-dev libtool libyaml-dev sqlite3 zlib1g-dev libgmp-dev libreadline-dev libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Create ide user and project directory.
RUN addgroup --gid ${IDE_GID} ide \
&& adduser --disabled-password --gecos '' --uid ${IDE_UID} --gid ${IDE_GID} ide \
&& usermod -a -G staff ide \
&& chmod g+rw /home \
&& mkdir -p /home/ide/project \
&& chown -R ide:ide /home/ide \
&& mkdir -p /ide \
&& chown -R ide:ide /ide
# Make tools like Yarn accessible.
# @see https://yarnpkg.com/getting-started/install
RUN corepack enable
USER ide
### Builder stages.
# We build some dependencies in parallel stages to speed up the build and reduce the final image size.
# @see https://docs.docker.com/build/building/multi-stage/
# We use the same base to ensure common linked libraries, though this causes cache busting if the base image updates.
# Building in the base image also ensures all Ruby/Node build dependencies are available to the customer.
FROM base AS theia
ARG CURL
USER root
WORKDIR /ide/theia
ENV PUPPETEER_SKIP_DOWNLOAD=true
RUN apt-get update \
&& apt-get install -qqy --no-install-recommends libsecret-1-dev git \
&& apt-get upgrade -qqy \
&& rm -rf /var/lib/apt/lists/*
COPY theia /ide/theia
# @see https://github.com/theia-ide/theia-apps/blob/master/theia-docker/Dockerfile
RUN yarn \
&& NODE_OPTIONS='--max_old_space_size=4096' yarn build-theia \
&& yarn --production \
&& yarn autoclean --init \
&& echo *.ts >> .yarnclean \
&& echo *.ts.map >> .yarnclean \
&& echo *.spec.* >> .yarnclean \
&& echo *.tsx >> .yarnclean \
&& echo *.js.map >> .yarnclean \
&& yarn autoclean --force \
&& yarn cache clean \
&& rm -rf node_modules \
&& find browser/lib -name '*.js.map' -delete
FROM base AS rvm
ARG CURL
ARG RUBY_DEFAULT_VERSION="3.4.9"
RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB \
&& $CURL https://get.rvm.io | bash -s stable --autolibs=read-fail \
&& bash -l -c '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' \
&& bash -l -c "rvm install ${RUBY_DEFAULT_VERSION}" \
&& bash -l -c "rvm --default use ${RUBY_DEFAULT_VERSION}" \
&& bash -l -c "rvm cleanup all"
FROM base AS nvm
ARG CURL
ARG NODE_DEFAULT_VERSION="v22.22.1"
ARG NVM_VERSION="0.40.4"
RUN $CURL -o- https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | bash \
&& export NVM_DIR="$HOME/.nvm" \
&& . ~/.nvm/nvm.sh \
# Force binary install to keep the build deterministic.
&& nvm install -b --latest-npm "${NODE_DEFAULT_VERSION}" \
&& chown -R ide:ide "${NVM_DIR}" \
&& nvm alias default "${NODE_DEFAULT_VERSION}"
### Main build stage.
FROM base AS ide
ARG CURL
# Install end-user dependencies.
# We should try to reduce the size of this step by moving dependencies such as MySQL into separate containers.
# Acquia apt repositories require cloudservicesdev access.
COPY build_files/acquia-apt.pref /etc/apt/preferences.d/
COPY build_files/acquia-apt.conf /etc/apt/apt.conf.d/
ARG CHROME_VERSION="146.0.7680.71-1"
ARG PYTHON_VERSION="3.13"
ARG PYTHON2_VERSION="2.7"
ARG PYTHON_FULL_VERSION="3.13.11"
ARG JFROG_USER
USER root
ARG TARGETARCH
RUN --mount=type=secret,id=s3auth,dst=/etc/apt/s3auth.conf \
--mount=type=secret,id=JFROG_READONLY,required=true \
$CURL https://${JFROG_USER}:$(cat /run/secrets/JFROG_READONLY)@jfrog.ais.acquia.io/artifactory/gpg-keys-federated/devops-pipeline-debian-gpg.pub -o /run/secrets/JFROG_GPG_KEY \
&& echo "deb [signed-by=/run/secrets/JFROG_GPG_KEY] https://${JFROG_USER}:$(cat /run/secrets/JFROG_READONLY)@jfrog.ais.acquia.io/artifactory/devops-pipeline-debian-prod-federated jammy main" > /etc/apt/sources.list.d/cloud_apt.list \
&& update-ca-certificates \
&& apt-get update -y \
# Bootstrap dependencies to set up apt.
# Debsums is a percona dependency (todo: fix the deb package so this isn't required)
&& apt-get install -qqy --no-install-recommends apt-transport-s3 apt-transport-https debsums \
# Add custom repositories.
&& add-apt-repository -y ppa:git-core/ppa \
# Step 1: Download latest Percona release package
&& $CURL https://repo.percona.com/apt/percona-release_latest.generic_all.deb -o /tmp/percona.deb \
# Step 2: Install the Percona release package
&& dpkg -i /tmp/percona.deb \
&& rm /tmp/percona.deb \
# Step 3: Enable Percona Server 8.0 repository
&& percona-release setup ps80 \
# Step 4: Update APT cache (now includes Percona packages)
&& apt-get update \
# Install and upgrade apt packages.
&& apt-get install -qqy --no-install-recommends \
# Theia keyserver package dependency.
libsecret-1-0 \
# Requirements for RVM.
libgmp-dev \
# Image processing libraries (*magick required by the ImageMagick module).
ghostscript imagemagick graphicsmagick \
# Image processing libraries for the Drupal Image Optimize module and ecosystem.
pngcrush libjpeg-progs \
# Top-level dependencies.
apache2 libapache2-mod-fcgid git jq keychain nano rsync ssh man-db \
wget zip zlib1g-dev unzip pv acquiaphp74 acquiaphp82 acquiaphp83 acquiaphp84 acquiaphp85 \
# Step 5: Install Percona Server 8.0 and client (MySQL 8.0 compatible)
percona-server-server percona-server-client ack-grep ncdu strace \
# Compatibility with BackstopJS (needed by ACMS dev team).
libxss1 \
# Install tini vim cron syslog-ng.
tini vim cron syslog-ng \
# Playwright dependency.
libx11-xcb1 \
# Upgrade all packages to latest versions for security after installation
&& apt-get upgrade -qqy \
# Install Chrome.
# There's no way to run Chrome on arm64 :(
&& case ${TARGETARCH} in \
amd64) $CURL http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb -o /tmp/chrome.deb \
&& apt-get install -qqy --no-install-recommends /tmp/chrome.deb \
&& rm /tmp/chrome.deb ;; \
esac \
# Fix broken dependencies and reconfigure packages \
&& apt-get -f install -qqy \
&& dpkg --configure -a \
# Clean up package cache to reduce image size
&& apt-get autoremove -y \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* \
# MySQL and Percona name services differently.
&& mv /etc/init.d/mysql /etc/init.d/mysqld \
# Percona initializes /var/lib/mysql on install, interfering with run.sh later.
&& rm -rf /var/lib/mysql
# Python setup and configuration
RUN --mount=type=secret,id=s3auth,dst=/etc/apt/s3auth.conf \
--mount=type=secret,id=JFROG_READONLY,required=true \
set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
python${PYTHON2_VERSION} \
build-essential libssl-dev libffi-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev \
xz-utils liblzma-dev tk-dev libgdbm-dev libgdbm-compat-dev uuid-dev wget ca-certificates; \
wget -q https://www.python.org/ftp/python/${PYTHON_FULL_VERSION}/Python-${PYTHON_FULL_VERSION}.tgz -O /tmp/Python.tgz; \
tar -xf /tmp/Python.tgz -C /tmp; \
cd /tmp/Python-${PYTHON_FULL_VERSION}; \
./configure --enable-optimizations --with-ensurepip=install --prefix=/usr/local/python${PYTHON_VERSION}; \
make -j"$(nproc)"; \
make install; \
ln -sf /usr/local/python${PYTHON_VERSION}/bin/python3 /usr/bin/python${PYTHON_VERSION}; \
ln -sf /usr/local/python${PYTHON_VERSION}/bin/pip3 /usr/bin/pip${PYTHON_VERSION}; \
/usr/local/python${PYTHON_VERSION}/bin/pip3 install --upgrade pip setuptools; \
rm -rf /tmp/Python-${PYTHON_FULL_VERSION} /tmp/Python.tgz; \
rm -rf /var/lib/apt/lists/*
# Set up Python alternatives.
# Override python3 to point to our custom Python 3.11 installation.
# Also set up the generic 'python' command with Python 2.7 as higher priority for backwards compatibility.
RUN set -eux; \
# Point python3 to our custom Python 3.11 \
if [ -x /usr/local/python${PYTHON_VERSION}/bin/python3 ]; then \
update-alternatives --install /usr/bin/python3 python3 /usr/local/python${PYTHON_VERSION}/bin/python3 50; \
fi; \
# System python3 (Ubuntu's Python 3.10) as fallback \
if [ -x /usr/bin/python3.10 ]; then \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 10; \
fi; \
# Set up generic 'python' command alternatives \
if [ -x /usr/bin/python${PYTHON2_VERSION} ]; then \
update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON2_VERSION} 2; \
fi; \
if [ -x /usr/local/python${PYTHON_VERSION}/bin/python3 ]; then \
update-alternatives --install /usr/bin/python python /usr/local/python${PYTHON_VERSION}/bin/python3 1; \
fi; \
# Set up pip3 to point to our custom Python 3.11's pip \
if [ -x /usr/local/python${PYTHON_VERSION}/bin/pip3 ]; then \
update-alternatives --install /usr/bin/pip3 pip3 /usr/local/python${PYTHON_VERSION}/bin/pip3 50; \
fi
RUN if ! getent group mysql >/dev/null; then \
groupadd mysql; \
fi \
&& usermod -a -G mysql ide
# .rvm-function is needed for RVM lazy loading.
COPY supporting_files/.rvm-function /ide/
COPY --chown=ide supporting_files/.acquiarc /home/ide/.acquiarc
COPY --chown=ide supporting_files/configs /home/ide/configs
# Replace system PHP with universal version wrappers.
COPY supporting_files/php/php supporting_files/php/phar /usr/bin/
# Manually enable PHP intl extension until CL removes the feature flag.
ARG LEGACY_PHP_VERSION="7.4"
ARG DEFAULT_PHP_VERSION="8.3"
ARG ALT_PHP_VERSION_1="8.2"
ARG ALT_PHP_VERSION_2="8.4"
ARG ALT_PHP_VERSION_3="8.5"
COPY supporting_files/php/xdebug2.ini /usr/local/php"${LEGACY_PHP_VERSION}"/etc/cli/conf.d/xdebug2.ini
COPY supporting_files/php/xdebug2.ini /usr/local/php"${LEGACY_PHP_VERSION}"/etc/fpm/conf.d/xdebug2.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${DEFAULT_PHP_VERSION}"/etc/cli/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${DEFAULT_PHP_VERSION}"/etc/fpm/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_1}"/etc/cli/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_1}"/etc/fpm/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_2}"/etc/cli/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_2}"/etc/fpm/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_3}"/etc/cli/conf.d/xdebug3.ini
COPY supporting_files/php/xdebug3.ini /usr/local/php"${ALT_PHP_VERSION_3}"/etc/fpm/conf.d/xdebug3.ini
RUN ln -sf /home/ide/configs/php/xdebug.ini /usr/local/php${LEGACY_PHP_VERSION}/etc/conf.d/xdebug.ini \
&& ln -sf /home/ide/configs/php/xdebug.ini /usr/local/php${DEFAULT_PHP_VERSION}/etc/conf.d/xdebug.ini \
&& ln -sf /home/ide/configs/php/xdebug.ini /usr/local/php${ALT_PHP_VERSION_1}/etc/conf.d/xdebug.ini \
&& ln -sf /home/ide/configs/php/xdebug.ini /usr/local/php${ALT_PHP_VERSION_2}/etc/conf.d/xdebug.ini \
&& ln -sf /home/ide/configs/php/xdebug.ini /usr/local/php${ALT_PHP_VERSION_3}/etc/conf.d/xdebug.ini
# Acquia PHP 7.4 decided to move this config directory ¯\_(ツ)_/¯
RUN sed -i 's/pool.d/php-fpm.d/g' /usr/local/php"${LEGACY_PHP_VERSION}"/etc/php-fpm.conf.default
# Apache configuration.
RUN a2enmod rewrite headers actions alias proxy_fcgi \
# Give Apache and PHP write permissions to the app
&& usermod -u ${DOCKER_ID} www-data \
&& usermod -G staff www-data \
&& usermod -a -G staff mysql \
&& groupmod -g $(($DOCKER_GID + 10000)) $(getent group $DOCKER_GID | cut -d: -f1) \
&& groupmod -g ${DOCKER_GID} staff \
# AMA D7 files directories.
&& mkdir -p /home/ide/ama_source/files-private \
&& chown -R ide:ide /home/ide/ama_source/ \
# Setup Apache and enable custom user config
&& rm /etc/apache2/sites-available/* \
&& sed -i '/^#ServerRoot ".*/a LimitRequestFieldSize 1048576' /etc/apache2/apache2.conf \
&& echo "ServerName localhost" >> /etc/apache2/apache2.conf \
&& echo 'Header always unset X-Frame-Options' >> /etc/apache2/apache2.conf \
&& echo 'Header set X-Frame-Options ALLOWALL' >> /etc/apache2/apache2.conf \
&& echo 'IncludeOptional /home/ide/configs/apache2/*.conf' >> /etc/apache2/apache2.conf \
# Enable custom user config for MySQL
&& echo '!includedir /home/ide/configs/mysql/' >> /etc/mysql/my.cnf
# Install Ansible and Supervisor via pip so we can keep them current.
ARG ANSIBLE_CORE_VERSION="v2.20.3"
# We need to install pip this way, since our system is too old. The bcrypt
# dependency is important so we can pre-provision the SSH key pair.
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} \
&& python3 -m pip install --upgrade pip setuptools \
&& python3 -m pip install --no-cache-dir ansible-core==${ANSIBLE_CORE_VERSION} bcrypt \
&& python3 -m pip install --no-cache-dir supervisor \
# Create symlinks for Ansible and Supervisor executables so they are accessible system-wide.
&& for b in ansible ansible-playbook ansible-galaxy ansible-config ansible-inventory ansible-vault supervisord supervisorctl; do \
if [ -x "/usr/local/python${PYTHON_VERSION}/bin/$b" ] && [ ! -e "/usr/local/bin/$b" ]; then \
ln -s "/usr/local/python${PYTHON_VERSION}/bin/$b" /usr/local/bin/$b; \
fi; \
done
RUN ansible-galaxy collection install community.crypto
# Composer 2.
ARG COMPOSER_VERSION="2.9.5"
RUN $CURL https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar -o /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer
# BLT Launcher.
ARG BLT_LAUNCHER_VERSION="1.1.0"
RUN $CURL https://github.com/acquia/blt-launcher/releases/download/v${BLT_LAUNCHER_VERSION}/blt.phar -o /usr/local/bin/blt \
&& chmod +x /usr/local/bin/blt
# Drush 8.
ARG DRUSH_VERSION="8.5.0"
RUN $CURL https://github.com/drush-ops/drush/releases/download/${DRUSH_VERSION}/drush.phar -o /usr/local/bin/drush8 \
&& chmod +x /usr/local/bin/drush8
# Drush Launcher.
ARG DRUSH_LAUNCHER_VERSION="0.10.2"
RUN $CURL https://github.com/drush-ops/drush-launcher/releases/download/${DRUSH_LAUNCHER_VERSION}/drush.phar -o /usr/local/bin/drush \
&& chmod +x /usr/local/bin/drush
# GitLab CLI.
ARG GITLAB_CLI_VERSION="1.89.0"
RUN $CURL https://gitlab.com/gitlab-org/cli/-/releases/v${GITLAB_CLI_VERSION}/downloads/glab_${GITLAB_CLI_VERSION}_linux_amd64.deb -o /tmp/glab.deb \
&& dpkg -i /tmp/glab.deb \
&& rm /tmp/glab.deb
# Github CLI.
ARG GH_VERSION="2.88.0"
RUN $CURL https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${TARGETARCH}.deb -o /tmp/gh.deb \
&& dpkg -i /tmp/gh.deb \
&& rm /tmp/gh.deb
# Chrome WebDriver.
ARG CHROMEDRIVER_VERSION="146.0.7680.71"
RUN mkdir -p /opt/chromedriver-${CHROMEDRIVER_VERSION} && \
$CURL -o /tmp/chromedriver_linux64.zip https://storage.googleapis.com/chrome-for-testing-public/${CHROMEDRIVER_VERSION}/linux64/chromedriver-linux64.zip && \
unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-${CHROMEDRIVER_VERSION} && \
rm /tmp/chromedriver_linux64.zip && \
chmod +x /opt/chromedriver-${CHROMEDRIVER_VERSION}/chromedriver-linux64/chromedriver && \
ln -fs /opt/chromedriver-${CHROMEDRIVER_VERSION}/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver
# Acquia CLI.
ARG ACLI_VERSION="2.59.0"
RUN mkdir /opt/local \
&& $CURL https://github.com/acquia/cli/releases/download/${ACLI_VERSION}/acli.phar -o /opt/local/acli \
&& chmod +x /opt/local/acli \
&& ln -s /opt/local/acli /usr/local/bin/acli \
# Ensure Acquia CLI can be updated by the end user.
&& chown -R ide:ide /opt/local
USER ide
# Install Code Sniffer.
RUN /usr/local/php${DEFAULT_PHP_VERSION}/bin/php /usr/local/bin/composer \
global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true \
&& /usr/local/php${DEFAULT_PHP_VERSION}/bin/php /usr/local/bin/composer \
global require squizlabs/php_codesniffer:^3.13 \
&& /usr/local/php${DEFAULT_PHP_VERSION}/bin/php /usr/local/bin/composer \
global require dealerdirect/phpcodesniffer-composer-installer:^1 \
&& /usr/local/php${DEFAULT_PHP_VERSION}/bin/php /usr/local/bin/composer \
global require drupal/coder:^8.3
# Install Adminer (a minimalistic database UI).
COPY --chown=ide supporting_files/database /ide/adminer/
ARG ADMINER_VERSION="5.2.1"
RUN $CURL https://github.com/vrana/adminer/releases/download/v${ADMINER_VERSION}/adminer-${ADMINER_VERSION}-mysql-en.php -o /ide/adminer/adminer.php \
&& $CURL https://raw.githubusercontent.com/vrana/adminer/v5.1.1/plugins/plugin.php -o /ide/adminer/plugins/plugin.php \
&& $CURL https://raw.githubusercontent.com/arxeiss/Adminer-FillLoginForm/v2.0/fill-login-form.php -o /ide/adminer/plugins/fill-login-form.php
# Set up Bash profile.
RUN echo "source /home/ide/.acquiarc" >> /home/ide/.bashrc \
&& echo 'export PATH="$PATH:$HOME/.rvm/bin"' >> /home/ide/.bashrc \
&& echo "source /ide/.rvm-function" >> /home/ide/.bashrc \
&& echo "export PATH=/home/ide/.rvm/gems/ruby-${RUBY_DEFAULT_VERSION}/bin:\$PATH" >> /home/ide/.acquiarc \
&& echo '[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile' >> /home/ide/.bash_profile \
&& echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*' >> /home/ide/.bash_profile
### COPY steps.
# Any change to these files will invalidate the build cache,
# so no more heavy downloads / installs after this point!
USER root
# Assemble RVM, NVM, and Theia.
COPY --from=rvm --chown=ide /home/ide/.rvm /home/ide/.rvm
COPY --from=nvm --chown=ide /home/ide/.nvm /home/ide/.nvm
COPY --from=theia --chown=ide /ide/theia /ide/theia
COPY --chown=ide supporting_files/ide/theia_settings.json /home/ide/.theia/settings.json
COPY --chown=ide supporting_files/ide/theia_launch.json /home/ide/.theia/launch.json
COPY --chown=ide supporting_files/ide/theia_launch.json /ide/launch.json
COPY --chown=ide supporting_files/welcome /home/ide/welcome
# supervisor configuration
COPY supporting_files/supervisord.conf /etc/supervisor/supervisord.conf
COPY supporting_files/httpd/supervisord-apache2.conf \
supporting_files/ide/supervisord-ide.conf \
supporting_files/mysql/supervisord-mysqld.conf \
supporting_files/php/supervisord-php-fpm.conf \
/etc/supervisor/conf.d/
# Startup scripts.
COPY supporting_files/ide/start-ide.sh \
supporting_files/httpd/apache2-foreground \
supporting_files/php/start-php-fpm.sh \
# openvscode-server / Theia backend selection.
supporting_files/ide/ide-backend-select.sh \
# Shell scripts, Drupal config overrides, and keychain config.
supporting_files/acli.sh \
supporting_files/creds.json \
supporting_files/drupal-settings.inc \
supporting_files/drupal-setup.sh \
supporting_files/mysql/create_mysql_users.sh \
supporting_files/php/php-setup.sh \
supporting_files/php/php-version-select.sh \
supporting_files/platform-setup.sh \
supporting_files/provisioning \
supporting_files/provisioning-setup.sh \
supporting_files/run.sh \
supporting_files/mysql/create_mysql_users.sh \
supporting_files/reset-workspace.py \
supporting_files/keychain-setup.sh \
supporting_files/process-exec-check.sh \
/ide/
# Drupal watchdog support.
COPY supporting_files/drupal.conf /etc/syslog-ng/conf.d/
# MySQL custom configs.
COPY supporting_files/mysql/overrides.cnf /etc/mysql/mysql.conf.d/
# User configs.
COPY --chown=ide supporting_files/configs/ssh/config /home/ide/.ssh/config
COPY --chown=ide supporting_files/configs/git/gitconfig /home/ide/.gitconfig
# Cloud Next filesystem compatibility.
VOLUME /mnt
VOLUME /shared
# Copy home directory contents so that we can restore it on the persistent volume in run.sh script
RUN mv /home /ide/home \
# Align Ruby and RVM default version.
&& ln -sf /home/ide/.rvm/rubies/default/bin/ruby /usr/bin/ruby \
# Configure Cloud Next filesystem mappings.
&& mkdir /mnt/gfs \
&& mkdir -p /shared/config/sync \
&& mkdir -p /shared/legacy-files \
&& mkdir -p /shared/logs \
&& mkdir -p /shared/php_sessions \
&& mkdir -p /shared/private-files \
&& mkdir -p /shared/tmp \
&& chown -R ide:ide /shared/*
# Ansible configuration
COPY supporting_files/provisioning /ide/provisioning
# Ansible no longer provides a default config file; it's safe to create our own in its place.
COPY supporting_files/configs/ansible/ansible.cfg /etc/ansible/ansible.cfg
RUN touch /var/log/ansible.log \
&& chown ide:ide /var/log/ansible.log
EXPOSE 80 22 3000
### ENV steps.
# All non-build ENV definitions go here.
ENV SHELL=/bin/bash
ENV EDITOR="vim"
ENV GITLAB_HOST="https://code.acquia.com/"
# Required variables for Drupal's test suite.
ENV SIMPLETEST_DB="mysql://drupal:drupal@127.0.0.1/drupal"
ENV SIMPLETEST_BASE_URL="http://127.0.0.1"
ENV MINK_DRIVER_ARGS_WEBDRIVER='["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless","--disable-dev-shm-usage"]}}, "http://127.0.0.1:4444"]'
ENV DTT_BASE_URL="${SIMPLETEST_BASE_URL}"
ENV DTT_MINK_DRIVER_ARGS="${MINK_DRIVER_ARGS_WEBDRIVER}"
ENV DRUSH_LAUNCHER_FALLBACK=/usr/local/bin/drush8
# Use tini to manage processes.
CMD ["/usr/bin/tini", "--", "/ide/run.sh"]