From 727d1556431ab731809d91f4dc12dbb39d1dc4d5 Mon Sep 17 00:00:00 2001 From: szEvEz Date: Tue, 17 Oct 2023 11:02:34 +0200 Subject: [PATCH] Minor improvements - Replace deprecated label MAINTAINER - Some hadolinting for Multiple consecutive `RUN` instructions Signed-off-by: szEvEz --- alpine-ansible-latest/Dockerfile | 4 ++-- amazon2-ansible-latest/Dockerfile | 2 +- amazon2023-ansible-latest/Dockerfile | 18 +++++++++--------- arch-ansible-latest/Dockerfile | 2 +- centos7-ansible-latest/Dockerfile | 8 +++----- centos8-ansible-latest/Dockerfile | 10 +++++----- centosstream8-ansible-latest/Dockerfile | 10 +++++----- centosstream9-ansible-latest/Dockerfile | 10 +++++----- debian10-ansible-latest/Dockerfile | 2 +- opensuse_tumbleweed-ansible-latest/Dockerfile | 6 +++--- openwrt-ansible-latest/Dockerfile | 6 +++--- oracle7-ansible-latest/Dockerfile | 2 +- rocky8-ansible-latest/Dockerfile | 11 +++++------ rocky9-ansible-latest/Dockerfile | 11 +++++------ ubuntu1804-ansible-latest/Dockerfile | 2 +- ubuntu2004-ansible-latest/Dockerfile | 2 +- ubuntu2204-ansible-latest/Dockerfile | 2 +- 17 files changed, 52 insertions(+), 56 deletions(-) diff --git a/alpine-ansible-latest/Dockerfile b/alpine-ansible-latest/Dockerfile index e85ad0b..95446a2 100644 --- a/alpine-ansible-latest/Dockerfile +++ b/alpine-ansible-latest/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" -RUN apk add --update ansible +RUN apk add --no-cache ansible # Install Ansible inventory file RUN mkdir -p /etc/ansible \ diff --git a/amazon2-ansible-latest/Dockerfile b/amazon2-ansible-latest/Dockerfile index 8286a2d..f82165b 100644 --- a/amazon2-ansible-latest/Dockerfile +++ b/amazon2-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM amazonlinux:2 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Install Ansible and other requirements. RUN rpm -ihv http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm diff --git a/amazon2023-ansible-latest/Dockerfile b/amazon2023-ansible-latest/Dockerfile index d75bb9a..c828bbf 100644 --- a/amazon2023-ansible-latest/Dockerfile +++ b/amazon2023-ansible-latest/Dockerfile @@ -1,17 +1,17 @@ FROM amazonlinux:2023 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Install Ansible and other requirements. -RUN yum makecache --timer \ - && yum -y install initscripts \ - && yum -y update \ - && yum -y install \ +RUN yum makecache --timer && \ + yum -y install initscripts && \ + yum -y update && \ + yum -y install \ sudo \ which \ hostname \ python3 \ - python3-pip \ - && yum clean all + python3-pip && \ + yum clean all RUN pip3 install ansible @@ -19,8 +19,8 @@ RUN pip3 install ansible RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/arch-ansible-latest/Dockerfile b/arch-ansible-latest/Dockerfile index 42e9adf..462860e 100644 --- a/arch-ansible-latest/Dockerfile +++ b/arch-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM archlinux:latest -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Update, install sudo and systemd, cleanup and remove unneeded unit files. RUN pacman -S -y \ diff --git a/centos7-ansible-latest/Dockerfile b/centos7-ansible-latest/Dockerfile index 1e29b83..03742d9 100644 --- a/centos7-ansible-latest/Dockerfile +++ b/centos7-ansible-latest/Dockerfile @@ -1,10 +1,9 @@ FROM centos:7 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 - # Install systemd -- See https://hub.docker.com/_/centos/ RUN yum -y update; yum clean all; \ (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ @@ -38,9 +37,8 @@ RUN yum -y install yum-plugin-copr libseccomp && \ RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Upgrade pip so cryptography package works. -RUN python3 -m pip install --upgrade pip - -RUN pip3 install ansible +RUN python3 -m pip install --upgrade pip && \ + pip3 install ansible # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/centos8-ansible-latest/Dockerfile b/centos8-ansible-latest/Dockerfile index 0fa18f4..8a746fa 100644 --- a/centos8-ansible-latest/Dockerfile +++ b/centos8-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM centos:8 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker # Install systemd -- See https://hub.docker.com/_/centos/ @@ -27,15 +27,15 @@ RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos && yum clean all # upgrade pip because of the rust dependency error -RUN python3 -m pip install --upgrade pip -RUN pip3 install ansible +RUN python3 -m pip install --upgrade pip && \ + pip3 install ansible # Disable requiretty. RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/centosstream8-ansible-latest/Dockerfile b/centosstream8-ansible-latest/Dockerfile index 2613a3a..56d7bc0 100644 --- a/centosstream8-ansible-latest/Dockerfile +++ b/centosstream8-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM quay.io/centos/centos:stream8 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker # Install systemd -- See https://hub.docker.com/_/centos/ @@ -27,15 +27,15 @@ RUN yum makecache --timer \ && yum clean all # upgrade pip because of the rust dependency error -RUN python3 -m pip install --upgrade pip -RUN pip3 install ansible +RUN python3 -m pip install --upgrade pip && \ + pip3 install ansible # Disable requiretty. RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/centosstream9-ansible-latest/Dockerfile b/centosstream9-ansible-latest/Dockerfile index ab05f51..a0b63f4 100644 --- a/centosstream9-ansible-latest/Dockerfile +++ b/centosstream9-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM quay.io/centos/centos:stream9 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker # Install systemd -- See https://hub.docker.com/_/centos/ @@ -25,15 +25,15 @@ RUN yum makecache --timer \ && yum clean all # upgrade pip because of the rust dependency error -RUN python3 -m pip install --upgrade pip -RUN pip3 install ansible +RUN python3 -m pip install --upgrade pip && \ + pip3 install ansible # Disable requiretty. RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/debian10-ansible-latest/Dockerfile b/debian10-ansible-latest/Dockerfile index 18b1490..a27fe2b 100644 --- a/debian10-ansible-latest/Dockerfile +++ b/debian10-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM debian:buster -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" RUN apt-get update -y && apt-get install --fix-missing && \ DEBIAN_FRONTEND=noninteractive \ diff --git a/opensuse_tumbleweed-ansible-latest/Dockerfile b/opensuse_tumbleweed-ansible-latest/Dockerfile index 4763429..ba41262 100644 --- a/opensuse_tumbleweed-ansible-latest/Dockerfile +++ b/opensuse_tumbleweed-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM opensuse/tumbleweed:latest -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker RUN zypper install -y python ansible dbus-1 systemd-sysvinit shadow sudo @@ -8,8 +8,8 @@ RUN cp /usr/lib/systemd/system/dbus.service /etc/systemd/system/; \ sed -i 's/OOMScoreAdjust=-900//' /etc/systemd/system/dbus.service # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/openwrt-ansible-latest/Dockerfile b/openwrt-ansible-latest/Dockerfile index acbf4de..9298a30 100644 --- a/openwrt-ansible-latest/Dockerfile +++ b/openwrt-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM openwrt/rootfs:latest -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" RUN mkdir -p /var/lock && \ opkg update && \ @@ -7,8 +7,8 @@ RUN mkdir -p /var/lock && \ opkg install python3 python3-pip python3-cryptography \ sudo bash sed shadow-su shadow-groupadd shadow-useradd shadow-usermod -RUN pip3 install --upgrade pip -RUN pip3 install ansible +RUN pip3 install --upgrade pip && \ + pip3 install ansible # Install Ansible inventory file RUN mkdir -p /etc/ansible \ diff --git a/oracle7-ansible-latest/Dockerfile b/oracle7-ansible-latest/Dockerfile index f639c0c..868d49e 100644 --- a/oracle7-ansible-latest/Dockerfile +++ b/oracle7-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM oraclelinux:7-slim -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Add Oracle EPEL repo that contains Ansible RUN yum-config-manager --add-repo=http://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/x86_64/ diff --git a/rocky8-ansible-latest/Dockerfile b/rocky8-ansible-latest/Dockerfile index 0618382..d5eb5d1 100644 --- a/rocky8-ansible-latest/Dockerfile +++ b/rocky8-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM rockylinux/rockylinux:8 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker # Install systemd -- See https://hub.docker.com/_/centos/ @@ -26,16 +26,15 @@ RUN yum makecache --timer \ && yum clean all # upgrade pip because of the rust dependency error -RUN pip3 install --upgrade pip - -RUN pip3 install ansible +RUN pip3 install --upgrade pip && \ + pip3 install ansible # Disable requiretty. RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/rocky9-ansible-latest/Dockerfile b/rocky9-ansible-latest/Dockerfile index 7baf83a..afb16c7 100644 --- a/rocky9-ansible-latest/Dockerfile +++ b/rocky9-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM docker.io/rockylinux/rockylinux:9 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" ENV container=docker # Install systemd -- See https://hub.docker.com/_/centos/ @@ -18,16 +18,15 @@ RUN yum makecache --timer \ && yum clean all # upgrade pip because of the rust dependency error -RUN pip3 install --upgrade pip - -RUN pip3 install ansible +RUN pip3 install --upgrade pip && \ + pip3 install ansible # Disable requiretty. RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers # Install Ansible inventory file. -RUN mkdir -p /etc/ansible -RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts +RUN mkdir -p /etc/ansible && \ + echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts # https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user # Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP` diff --git a/ubuntu1804-ansible-latest/Dockerfile b/ubuntu1804-ansible-latest/Dockerfile index d81f9f4..a2ce856 100644 --- a/ubuntu1804-ansible-latest/Dockerfile +++ b/ubuntu1804-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:18.04 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Install dependencies. RUN apt-get update \ diff --git a/ubuntu2004-ansible-latest/Dockerfile b/ubuntu2004-ansible-latest/Dockerfile index 0873206..c5e4c4a 100644 --- a/ubuntu2004-ansible-latest/Dockerfile +++ b/ubuntu2004-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:20.04 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Install dependencies. RUN apt-get update \ diff --git a/ubuntu2204-ansible-latest/Dockerfile b/ubuntu2204-ansible-latest/Dockerfile index b66f660..12133a1 100644 --- a/ubuntu2204-ansible-latest/Dockerfile +++ b/ubuntu2204-ansible-latest/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:22.04 -MAINTAINER Sebastian Gumprich +LABEL maintainer="Sebastian Gumprich" # Install dependencies. RUN apt-get update \