From 1a2c4b6a2a2fa4e00f7d9f0f812839cc55307a88 Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:24:50 -0700 Subject: [PATCH 1/6] fix(relint-base): Install jq as a package --- dockerfiles/relint-base/Dockerfile | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/dockerfiles/relint-base/Dockerfile b/dockerfiles/relint-base/Dockerfile index e1f7feb1..dcbd8bc6 100644 --- a/dockerfiles/relint-base/Dockerfile +++ b/dockerfiles/relint-base/Dockerfile @@ -1,13 +1,11 @@ FROM golang:1.20.7-bullseye -ENV jq_version 1.6 -ENV jq_checksum 056ba5d6bbc617c29d37158ce11fd5a443093949 - RUN \ apt-get update && \ apt-get -y install \ build-essential \ git \ + jq \ ruby \ unzip \ wget \ @@ -17,13 +15,6 @@ RUN \ RUN dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep -# jq -RUN \ - wget https://github.com/stedolan/jq/releases/download/jq-${jq_version}/jq-linux64 --output-document="/usr/bin/jq" && \ - cd /usr/bin && \ - echo "${jq_checksum} jq" | sha1sum -c - && \ - chmod +x jq - # yq RUN \ pip3 install yq From adff8d62d373f679715bf84d4f6b8110a01c6881 Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:25:23 -0700 Subject: [PATCH 2/6] refactor(relint-base): Sort package installation in ascending alphabetical order --- dockerfiles/relint-base/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dockerfiles/relint-base/Dockerfile b/dockerfiles/relint-base/Dockerfile index dcbd8bc6..d2a7bf27 100644 --- a/dockerfiles/relint-base/Dockerfile +++ b/dockerfiles/relint-base/Dockerfile @@ -3,15 +3,15 @@ FROM golang:1.20.7-bullseye RUN \ apt-get update && \ apt-get -y install \ + ack-grep \ build-essential \ + curl \ git \ jq \ + python3-pip \ ruby \ unzip \ - wget \ - curl \ - ack-grep \ - python3-pip + wget RUN dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep From e717bbd141e55e2fac1938da30cf5312bdd3f84c Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:26:21 -0700 Subject: [PATCH 3/6] fix(relint-base): Remove seemingly unnecessary packages Some, like yq, appear to be unused. While some, like wget, are already installed. --- dockerfiles/relint-base/Dockerfile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dockerfiles/relint-base/Dockerfile b/dockerfiles/relint-base/Dockerfile index d2a7bf27..5335c545 100644 --- a/dockerfiles/relint-base/Dockerfile +++ b/dockerfiles/relint-base/Dockerfile @@ -4,21 +4,10 @@ RUN \ apt-get update && \ apt-get -y install \ ack-grep \ - build-essential \ - curl \ - git \ - jq \ - python3-pip \ - ruby \ - unzip \ - wget + jq RUN dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep -# yq -RUN \ - pip3 install yq - # Add trusted relint ca certificate ARG RELINT_CA_CERTIFICATE ARG PREVIOUS_RELINT_CA_CERTIFICATE From 8cc43b68db2dbb5a202bbff1d8dc621dc65035b2 Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:34:14 -0700 Subject: [PATCH 4/6] fix(dockerfiles/bosh-cli): Install bosh CLI pre-reqs --- dockerfiles/bosh-cli/Dockerfile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/dockerfiles/bosh-cli/Dockerfile b/dockerfiles/bosh-cli/Dockerfile index 30678c28..1b6f5527 100644 --- a/dockerfiles/bosh-cli/Dockerfile +++ b/dockerfiles/bosh-cli/Dockerfile @@ -2,10 +2,24 @@ FROM cloudfoundry/relint-base # bosh-cli ARG bosh_cli_version -RUN \ - wget https://s3.amazonaws.com/bosh-cli-artifacts/bosh-cli-${bosh_cli_version}-linux-amd64 --output-document="/usr/bin/bosh" && \ - cd /usr/bin && \ - chmod +x bosh +RUN set -eux; \ + apt-get -y install \ + build-essential \ + libreadline-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + libxslt1-dev \ + libyaml-dev \ + openssl \ + ruby \ + ruby-dev \ + sqlite3 \ + zlib1g-dev; \ + url="https://github.com/cloudfoundry/bosh-cli/releases/download/v${bosh_cli_version}/bosh-cli-${bosh_cli_version}-linux-amd64"; \ + wget "${url}" -O /usr/local/bin/bosh; \ + chmod +x /usr/local/bin/bosh; \ + bosh --version # bbl and dependencies ARG bbl_version From eec757982d47156b284337e7392a2c64ba232158 Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:49:11 -0700 Subject: [PATCH 5/6] fix(relint-base): Use ack package instead of ack-grep As of Debian 9, ack-grep became ack: https://beyondgrep.com/install/. --- dockerfiles/relint-base/Dockerfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dockerfiles/relint-base/Dockerfile b/dockerfiles/relint-base/Dockerfile index 5335c545..bf2d6c4e 100644 --- a/dockerfiles/relint-base/Dockerfile +++ b/dockerfiles/relint-base/Dockerfile @@ -3,11 +3,9 @@ FROM golang:1.20.7-bullseye RUN \ apt-get update && \ apt-get -y install \ - ack-grep \ + ack \ jq -RUN dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep - # Add trusted relint ca certificate ARG RELINT_CA_CERTIFICATE ARG PREVIOUS_RELINT_CA_CERTIFICATE From a583c1082431db4d85e568d55fb5e677dad679a2 Mon Sep 17 00:00:00 2001 From: Carson Long Date: Thu, 5 Oct 2023 16:55:58 -0700 Subject: [PATCH 6/6] refactor(relint-base): Reformat bash runs Seems nice to use `set` to get error checking and push up failures, which then also allows us to use semicolons instead of double ampersands to break lines. --- dockerfiles/relint-base/Dockerfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dockerfiles/relint-base/Dockerfile b/dockerfiles/relint-base/Dockerfile index bf2d6c4e..6d42254c 100644 --- a/dockerfiles/relint-base/Dockerfile +++ b/dockerfiles/relint-base/Dockerfile @@ -1,14 +1,15 @@ FROM golang:1.20.7-bullseye -RUN \ - apt-get update && \ - apt-get -y install \ - ack \ - jq +RUN set -eux; \ + apt-get update; \ + apt-get -y install \ + ack \ + jq # Add trusted relint ca certificate ARG RELINT_CA_CERTIFICATE ARG PREVIOUS_RELINT_CA_CERTIFICATE -RUN echo -n "$RELINT_CA_CERTIFICATE" > /usr/local/share/ca-certificates/relint.crt && \ - echo -n "$PREVIOUS_RELINT_CA_CERTIFICATE" > /usr/local/share/ca-certificates/previous_relint.crt && \ - /usr/sbin/update-ca-certificates -f +RUN set -e; \ + echo -n "${RELINT_CA_CERTIFICATE}" > /usr/local/share/ca-certificates/relint.crt; \ + echo -n "${PREVIOUS_RELINT_CA_CERTIFICATE}" > /usr/local/share/ca-certificates/previous_relint.crt; \ + /usr/sbin/update-ca-certificates -f