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