Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(relint-base): Use only necessary, latest packages in image #271

Merged
merged 6 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions dockerfiles/bosh-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 9 additions & 30 deletions dockerfiles/relint-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
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 \
ruby \
unzip \
wget \
curl \
ack-grep \
python3-pip

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
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