From c98a81fee333969ffbe9436785df1fd727001894 Mon Sep 17 00:00:00 2001 From: Tobias Ramm Date: Wed, 10 Jan 2024 06:30:41 +0100 Subject: [PATCH 1/5] Fix: WORKDIR instruction should be used instead of cd commands (docker:S6597) --- base/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 24d74cbd..052815e1 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -58,7 +58,7 @@ COPY files/st2.user.conf /etc/st2/ COPY files/st2ctl /etc/default/ # Use custom logging config that'll stream all st2 service logs to stdout and never save to files -RUN cd /etc/st2; \ +WORKDIR /etc/st2; \ for file in /etc/st2/logging.*.conf; do \ rm -f ${file}; \ ln -s logging.docker.conf ${file}; \ From d6907c3530047e9aa85ffabf7567e9e9451f343d Mon Sep 17 00:00:00 2001 From: Tobias Ramm Date: Wed, 10 Jan 2024 06:32:01 +0100 Subject: [PATCH 2/5] Fix: Cache should be cleaned after package installation (docker:S6587) --- base/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/Dockerfile b/base/Dockerfile index 052815e1..9dff5fe5 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -71,7 +71,9 @@ RUN apt-get install -y crudini \ && crudini --merge /etc/st2/st2.conf < /tmp/st2.tmp.conf \ && rm -f /tmp/st2.tmp.conf \ && apt-get purge -y crudini \ - && apt-get autoremove -y + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && apt-get clean # Add Custom "StackStorm" welcome message COPY files/.welcome.sh /etc/skel/.welcome From f146f5dae91e878503bcfac4c9a912c17b20a4f5 Mon Sep 17 00:00:00 2001 From: Tobias Ramm Date: Wed, 10 Jan 2024 06:34:14 +0100 Subject: [PATCH 3/5] Fix: Cache should be cleaned after package installation (docker:S6587) --- st2actionrunner/Dockerfile | 4 +++- st2web/Dockerfile | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/st2actionrunner/Dockerfile b/st2actionrunner/Dockerfile index 7b9ec63e..254d875d 100644 --- a/st2actionrunner/Dockerfile +++ b/st2actionrunner/Dockerfile @@ -7,7 +7,9 @@ RUN apt-get install -y rsync \ inetutils-traceroute \ net-tools \ dnsutils \ - sendmail + sendmail \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && apt-get clean USER root diff --git a/st2web/Dockerfile b/st2web/Dockerfile index c7a38e83..434a50b4 100644 --- a/st2web/Dockerfile +++ b/st2web/Dockerfile @@ -41,7 +41,9 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ABF5BD827B && echo "deb http://nginx.org/packages/ubuntu/ focal nginx" > /etc/apt/sources.list.d/nginx.list \ && apt-get update \ && apt-get install -y nginx \ - && rm -f /etc/apt/sources.list.d/nginx.list + && rm -f /etc/apt/sources.list.d/nginx.list \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && apt-get clean # Install StackStorm Web UI RUN if [ "${ST2_VERSION#*dev}" != "${ST2_VERSION}" ]; then \ @@ -71,7 +73,9 @@ RUN if [ "${ST2_VERSION#*dev}" != "${ST2_VERSION}" ]; then \ && rm -f /etc/nginx/conf.d/default.conf \ && rm -f /tmp/st2.conf.patch \ && rm -f /tmp/st2.conf-http.patch \ - && rm -f /tmp/st2.conf-https.patch + && rm -f /tmp/st2.conf-https.patch \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && apt-get clean # It's a user's responsbility to pass the valid SSL certificate files: 'st2.key' and 'st2.crt', used in nginx VOLUME ["/etc/ssl/st2/"] From e0dcd919007a06b64a1cfaa658c830f3a6542dc4 Mon Sep 17 00:00:00 2001 From: Tobias Ramm Date: Wed, 10 Jan 2024 06:39:44 +0100 Subject: [PATCH 4/5] update indentation --- st2actionrunner/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/st2actionrunner/Dockerfile b/st2actionrunner/Dockerfile index 254d875d..f8d317e3 100644 --- a/st2actionrunner/Dockerfile +++ b/st2actionrunner/Dockerfile @@ -8,8 +8,8 @@ RUN apt-get install -y rsync \ net-tools \ dnsutils \ sendmail \ - && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ - && apt-get clean + && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ + && apt-get clean USER root From 4ebcc3eb4889e06d9526e2c5caff9161e3f9f89b Mon Sep 17 00:00:00 2001 From: Tobias Ramm Date: Wed, 10 Jan 2024 10:09:48 +0100 Subject: [PATCH 5/5] Add apt-get update to update index for package installation --- st2actionrunner/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/st2actionrunner/Dockerfile b/st2actionrunner/Dockerfile index f8d317e3..986966d5 100644 --- a/st2actionrunner/Dockerfile +++ b/st2actionrunner/Dockerfile @@ -3,11 +3,12 @@ FROM stackstorm/st2:${ST2_VERSION} LABEL com.stackstorm.component="st2actionrunner" # Install utils used by st2 'linux' pack, part of StackStorm core -RUN apt-get install -y rsync \ - inetutils-traceroute \ - net-tools \ - dnsutils \ - sendmail \ +RUN apt-get -qq update \ + && apt-get install -y rsync \ + inetutils-traceroute \ + net-tools \ + dnsutils \ + sendmail \ && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* \ && apt-get clean