contrib/packaging/docker/centos7
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 12 May 2018 15:51:37 -0700
changeset 38457 11eda1f1b6e7
parent 38003 1335bbfb066f
child 41234 4c0d4bbdc395
permissions -rw-r--r--
packaging: consistently create build user in Dockerfiles Previously, dockerlib.sh appended some commands to create a "build" user in each Docker image. The resulting Docker images could be inconsistent depending on the execution environment and base image. With this change, we explicitly create our custom user and group as the first action in each Dockerfile. The user always has user:group 1000:1000 and all built images are consistent. We also create a home directory for the user under /build. This directory is currently ignored. As part of this, we stop setting the DBUILDUSER variable in dockerlib.sh and instead set it in the respective scripts that call it. This is in preparation for further refactoring of dockerlib.sh. Differential Revision: https://phab.mercurial-scm.org/D3758

FROM centos:centos7

RUN groupadd -g 1000 build && \
    useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build

RUN yum install -y \
	gcc \
	gettext \
	make \
	python-devel \
	python-docutils \
	rpm-build \
	tar

# For creating repo meta data
RUN yum install -y createrepo