infra/codestorage/hg-repo-sync
2015-10-14
Parent:9cc2f3a01ab5
infra/codestorage/hg-repo-sync/Dockerfile
Remove the hgrc file, fix permissions. When pulling backups, make sure we set the permissions to 0770 as well as change the group they belong to. This caused us to not be able to write changes (oops). Also, remove the hgrc file. Which means our annoying "not trusting file /mounted/repos/blah-blah/.hg/hgrc from untrusted user root, group committers" message is back, but that's a minor nuisance. The real issue is that we're overwriting the hgrc for everything _anyways_ to get the push hook, etc. So there seemed to be little point.
1 FROM ubuntu:14.04
2 MAINTAINER Paddy <paddy@secondbit.org>
4 RUN apt-get update && apt-get install -y python-pip python-dev wget unzip
5 RUN pip install Mercurial==3.5.2
6 RUN groupadd -g 2000 committers
8 RUN mkdir -p /mounted/repos
9 RUN chown -R root:committers /mounted/repos
10 RUN chmod 0770 /mounted/repos
12 VOLUME /mounted
14 RUN mkdir -p /tmp/repos
15 RUN chown -R root:committers /tmp/repos
16 RUN chmod 0770 /tmp/repos
18 ADD run.sh /usr/local/bin/helpers/run.sh
19 ADD sleep.sh /usr/local/bin/helpers/sleep.sh
20 ADD pull.sh /usr/local/bin/helpers/pull.sh
21 ADD push.sh /usr/local/bin/helpers/push.sh
22 RUN chmod +x /usr/local/bin/helpers/run.sh
23 RUN chmod +x /usr/local/bin/helpers/sleep.sh
24 RUN chmod +x /usr/local/bin/helpers/pull.sh
25 RUN chmod +x /usr/local/bin/helpers/push.sh
27 RUN wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip && unzip google-cloud-sdk.zip && rm google-cloud-sdk.zip
29 ENV CLOUDSDK_PYTHON_SITEPACKAGES 1
30 RUN google-cloud-sdk/install.sh --usage-reporting=false --path-update=true --bash-completion=false --rc-path=/.bashrc --disable-installation-options
31 RUN google-cloud-sdk/bin/gcloud --quiet components update pkg-go pkg-python pkg-java preview alpha beta app
32 RUN google-cloud-sdk/bin/gcloud --quiet config set component_manager/disable_update_check true
33 RUN mkdir /.ssh
34 ENV PATH /google-cloud-sdk/bin:$PATH
35 ENV HOME /
37 CMD ["/usr/local/bin/helpers/run.sh"]