2019-02-07 09:04:51 +03:00
|
|
|
# %ARG DOCKER_IMAGE_PARENT
|
|
|
|
FROM $DOCKER_IMAGE_PARENT
|
2018-01-25 16:15:19 +03:00
|
|
|
MAINTAINER Mike Hommey <mhommey@mozilla.com>
|
|
|
|
|
|
|
|
### Add worker user and setup its workspace.
|
|
|
|
RUN mkdir /builds && \
|
2018-01-03 00:22:36 +03:00
|
|
|
groupadd -g 1000 worker && \
|
|
|
|
useradd -u 1000 -g 1000 -d /builds/worker -s /bin/bash -m worker && \
|
2018-01-25 16:15:19 +03:00
|
|
|
mkdir -p /builds/worker/workspace && \
|
|
|
|
chown -R worker:worker /builds
|
|
|
|
|
|
|
|
# Declare default working folder
|
|
|
|
WORKDIR /builds/worker
|
|
|
|
|
2018-10-30 21:26:04 +03:00
|
|
|
VOLUME /builds/worker/checkouts
|
|
|
|
VOLUME /builds/worker/workspace
|
|
|
|
VOLUME /builds/worker/tooltool-cache
|
|
|
|
|
2018-01-25 16:15:19 +03:00
|
|
|
# Set variable normally configured at login, by the shells parent process, these
|
|
|
|
# are taken from GNU su manual
|
|
|
|
ENV HOME=/builds/worker \
|
|
|
|
SHELL=/bin/bash \
|
|
|
|
USER=worker \
|
|
|
|
LOGNAME=worker \
|
2019-02-07 09:04:51 +03:00
|
|
|
HOSTNAME=taskcluster-worker
|
2018-01-25 16:15:19 +03:00
|
|
|
|
|
|
|
# Set a default command useful for debugging
|
|
|
|
CMD ["/bin/bash", "--login"]
|
|
|
|
|
2018-09-25 23:18:19 +03:00
|
|
|
# %ARG TASKCLUSTER_ROOT_URL
|
2018-01-25 16:15:19 +03:00
|
|
|
# %ARG DOCKER_IMAGE_PACKAGES
|
2018-09-25 23:18:19 +03:00
|
|
|
RUN /usr/local/sbin/setup_packages.sh $TASKCLUSTER_ROOT_URL $DOCKER_IMAGE_PACKAGES && \
|
2018-01-25 16:15:19 +03:00
|
|
|
apt-get update && \
|
2019-04-05 01:16:01 +03:00
|
|
|
apt-get dist-upgrade && \
|
2018-01-25 16:15:19 +03:00
|
|
|
apt-get install \
|
|
|
|
git \
|
2018-06-26 04:59:34 +03:00
|
|
|
less \
|
2018-01-25 16:15:19 +03:00
|
|
|
make \
|
|
|
|
mercurial \
|
2018-06-26 04:59:34 +03:00
|
|
|
patch \
|
2018-01-25 16:15:19 +03:00
|
|
|
python \
|
2018-04-03 02:58:21 +03:00
|
|
|
python3.5 \
|
2018-05-10 05:54:21 +03:00
|
|
|
python3-minimal \
|
2018-06-05 09:21:19 +03:00
|
|
|
python-zstandard \
|
|
|
|
python3-zstandard \
|
2018-06-26 04:59:34 +03:00
|
|
|
vim-tiny \
|
2018-01-25 16:15:19 +03:00
|
|
|
xz-utils
|
|
|
|
|
|
|
|
# %include testing/mozharness/external_tools/robustcheckout.py
|
|
|
|
COPY topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py
|
|
|
|
|
|
|
|
# %include taskcluster/docker/recipes/hgrc
|
|
|
|
COPY topsrcdir/taskcluster/docker/recipes/hgrc /etc/mercurial/hgrc.d/mozilla.rc
|
|
|
|
|
|
|
|
# Add pip configuration, among other things.
|
|
|
|
# %include taskcluster/docker/recipes/dot-config
|
|
|
|
COPY topsrcdir/taskcluster/docker/recipes/dot-config /builds/worker/.config
|
|
|
|
|
2018-05-05 03:23:31 +03:00
|
|
|
# %include taskcluster/scripts/run-task
|
|
|
|
COPY topsrcdir/taskcluster/scripts/run-task /builds/worker/bin/run-task
|
2018-01-25 16:15:19 +03:00
|
|
|
|
2019-07-27 09:08:26 +03:00
|
|
|
# %include taskcluster/scripts/misc/fetch-content
|
|
|
|
ADD topsrcdir/taskcluster/scripts/misc/fetch-content /builds/worker/bin/fetch-content
|
|
|
|
|
2018-01-25 16:15:19 +03:00
|
|
|
RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*
|