docker: try to follow the best practices for writing Dockerfiles
authormuxator <a.mux@inwind.it>
Sun, 01 Oct 2017 01:02:22 +0200
changeset 34423 1baa077214ae
parent 34422 2fd06499dc8e
child 34424 e416819d9ebb
docker: try to follow the best practices for writing Dockerfiles Merged multiple RUN instructions and sorted the arguments alphabetically Reference: https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
contrib/docker/centos5
contrib/docker/centos6
contrib/docker/centos7
contrib/docker/debian.template
contrib/docker/fedora20
contrib/docker/fedora21
contrib/docker/ubuntu.template
--- a/contrib/docker/centos5	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/centos5	Sun Oct 01 01:02:22 2017 +0200
@@ -1,9 +1,23 @@
 FROM centos:centos5
-RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo
-RUN sed -i 's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/' /etc/yum.repos.d/*.repo
-RUN sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
-RUN yum install -y gcc make rpm-build gettext tar
-RUN yum install -y python-devel python-docutils
+RUN \
+	sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/*.repo && \
+	sed -i 's/^#\(baseurl=\)http:\/\/mirror.centos.org\/centos/\1http:\/\/vault.centos.org/' /etc/yum.repos.d/*.repo && \
+	sed -i 's/\$releasever/5.11/' /etc/yum.repos.d/*.repo
+
+RUN yum install -y \
+	gcc \
+	gettext \
+	make \
+	python-devel \
+	python-docutils \
+	rpm-build \
+	tar
+
 # For creating repo meta data
-RUN yum install -y createrepo
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
+RUN yum install -y \
+	bzip2-devel \
+	createrepo \
+	ncurses-devel \
+	openssl-devel \
+	readline-devel \
+	zlib-devel
--- a/contrib/docker/centos6	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/centos6	Sun Oct 01 01:02:22 2017 +0200
@@ -1,11 +1,20 @@
 FROM centos:centos6
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+	gcc \
+	gettext \
+	make \
+	python-devel \
+	python-docutils \
+	rpm-build \
+	tar
+
 # For creating repo meta data
 RUN yum install -y createrepo
+
 # For python
-RUN yum install -y readline-devel openssl-devel ncurses-devel zlib-devel bzip2-devel
+RUN yum install -y \
+	bzip2-devel \
+	ncurses-devel \
+	openssl-devel \
+	readline-devel \
+	zlib-devel
--- a/contrib/docker/centos7	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/centos7	Sun Oct 01 01:02:22 2017 +0200
@@ -1,9 +1,12 @@
 FROM centos:centos7
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
-RUN yum install -y tar
+RUN yum install -y \
+	gcc \
+	gettext \
+	make \
+	python-devel \
+	python-docutils \
+	rpm-build \
+	tar
+
 # For creating repo meta data
 RUN yum install -y createrepo
--- a/contrib/docker/debian.template	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/debian.template	Sun Oct 01 01:02:22 2017 +0200
@@ -2,11 +2,11 @@
 RUN apt-get update && apt-get install -y \
   build-essential \
   debhelper \
+  devscripts \
   dh-python \
-  devscripts \
   less \
   python \
   python-all-dev \
   python-docutils \
-  zip \
-  unzip
+  unzip \
+  zip
--- a/contrib/docker/fedora20	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/fedora20	Sun Oct 01 01:02:22 2017 +0200
@@ -1,8 +1,11 @@
 FROM fedora:20
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
+RUN yum install -y \
+	gcc \
+	gettext \
+	make \
+	python-devel \
+	python-docutils \
+	rpm-build
+
 # For creating repo meta data
 RUN yum install -y createrepo
--- a/contrib/docker/fedora21	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/fedora21	Sun Oct 01 01:02:22 2017 +0200
@@ -1,8 +1,11 @@
 FROM fedora:21
-RUN yum install -y gcc
-RUN yum install -y python-devel python-docutils
-RUN yum install -y make
-RUN yum install -y rpm-build
-RUN yum install -y gettext
+RUN yum install -y \
+	gcc \
+	gettext \
+	make \
+	python-devel \
+	python-docutils \
+	rpm-build
+
 # For creating repo meta data
 RUN yum install -y createrepo
--- a/contrib/docker/ubuntu.template	Thu Aug 24 18:40:30 2017 +0200
+++ b/contrib/docker/ubuntu.template	Sun Oct 01 01:02:22 2017 +0200
@@ -2,11 +2,11 @@
 RUN apt-get update && apt-get install -y \
   build-essential \
   debhelper \
+  devscripts \
   dh-python \
-  devscripts \
   less \
   python \
   python-all-dev \
   python-docutils \
-  zip \
-  unzip
+  unzip \
+  zip