Dockerfile (2519B)
1 FROM $DOCKER_IMAGE_PARENT 2 MAINTAINER Mike Hommey <mhommey@mozilla.com> 3 4 ### Add worker user and setup its workspace. 5 RUN mkdir -p /builds && \ 6 groupadd -g 1000 worker && \ 7 useradd -u 1000 -g 1000 -d /builds/worker -s /bin/bash -m worker && \ 8 mkdir -p /builds/worker/workspace && \ 9 chown -R worker:worker /builds 10 11 # Declare default working folder 12 WORKDIR /builds/worker 13 14 VOLUME /builds/worker/checkouts 15 VOLUME /builds/worker/workspace 16 VOLUME /builds/worker/tooltool-cache 17 18 # Set variable normally configured at login, by the shells parent process, these 19 # are taken from GNU su manual 20 ENV HOME=/builds/worker \ 21 SHELL=/bin/bash \ 22 USER=worker \ 23 LOGNAME=worker \ 24 HOSTNAME=taskcluster-worker 25 26 # Set a default command useful for debugging 27 CMD ["/bin/bash", "--login"] 28 29 ARG TASKCLUSTER_ROOT_URL 30 ARG DOCKER_IMAGE_PACKAGES 31 RUN /usr/local/sbin/setup_packages.sh $TASKCLUSTER_ROOT_URL $DOCKER_IMAGE_PACKAGES && \ 32 apt-get update && \ 33 apt-get dist-upgrade && \ 34 apt-get install \ 35 coreutils \ 36 git \ 37 less \ 38 make \ 39 mercurial \ 40 patch \ 41 python3.8 \ 42 python3.8-dev \ 43 python3.8-venv \ 44 python3-minimal \ 45 python3-zstandard \ 46 python3-psutil \ 47 python3-venv \ 48 vim-tiny \ 49 xz-utils \ 50 zstd \ 51 && /usr/local/sbin/clean_packages.sh $DOCKER_IMAGE_PACKAGES 52 53 RUN test $(readlink /usr/bin/python3) = python3.6 && ln -sf python3.8 /usr/bin/python3 54 55 # %include testing/mozharness/external_tools/robustcheckout.py 56 COPY topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py 57 58 # %include taskcluster/docker/recipes/hgrc 59 COPY topsrcdir/taskcluster/docker/recipes/hgrc /etc/mercurial/hgrc.d/mozilla.rc 60 61 # Add pip configuration, among other things. 62 # %include taskcluster/docker/recipes/dot-config 63 COPY topsrcdir/taskcluster/docker/recipes/dot-config /builds/worker/.config 64 65 # %include taskcluster/scripts/run-task 66 COPY topsrcdir/taskcluster/scripts/run-task /builds/worker/bin/run-task-hg 67 # %include third_party/python/taskcluster_taskgraph/taskgraph/run-task/run-task 68 COPY topsrcdir/third_party/python/taskcluster_taskgraph/taskgraph/run-task/run-task /builds/worker/bin/run-task-git 69 70 # %include third_party/python/taskcluster_taskgraph/taskgraph/run-task/fetch-content 71 ADD topsrcdir/third_party/python/taskcluster_taskgraph/taskgraph/run-task/fetch-content /builds/worker/bin/fetch-content 72 73 RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*