contrib/packaging/docker/fedora21
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 12 May 2018 15:51:37 -0700
changeset 38457 11eda1f1b6e7
parent 38003 1335bbfb066f
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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23882
272b1cc3e83e docker: support Fedora 21
Mads Kiilerich <madski@unity3d.com>
parents: 22444
diff changeset
     1
FROM fedora:21
38457
11eda1f1b6e7 packaging: consistently create build user in Dockerfiles
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38003
diff changeset
     2
11eda1f1b6e7 packaging: consistently create build user in Dockerfiles
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38003
diff changeset
     3
RUN groupadd -g 1000 build && \
11eda1f1b6e7 packaging: consistently create build user in Dockerfiles
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38003
diff changeset
     4
    useradd -u 1000 -g 1000 -s /bin/bash -d /build -m build
11eda1f1b6e7 packaging: consistently create build user in Dockerfiles
Gregory Szorc <gregory.szorc@gmail.com>
parents: 38003
diff changeset
     5
34423
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
     6
RUN yum install -y \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
     7
	gcc \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
     8
	gettext \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
     9
	make \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
    10
	python-devel \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
    11
	python-docutils \
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
    12
	rpm-build
1baa077214ae docker: try to follow the best practices for writing Dockerfiles
muxator <a.mux@inwind.it>
parents: 23882
diff changeset
    13
22444
49ea49823769 dockerrpm: create a yum/dnf repo from the generated rpms
Mads Kiilerich <madski@unity3d.com>
parents: 22442
diff changeset
    14
# For creating repo meta data
49ea49823769 dockerrpm: create a yum/dnf repo from the generated rpms
Mads Kiilerich <madski@unity3d.com>
parents: 22442
diff changeset
    15
RUN yum install -y createrepo