Skip to content

Commit b235c7f

Browse files
committed
feat: add yq to base image
1 parent de25d02 commit b235c7f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

containers/base/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ ARG ORAS_VERSION=1.3.0
1818
ARG ORAS_CHECKSUM=6cdc692f929100feb08aa8de584d02f7bcc30ec7d88bc2adc2054d782db57c64
1919
ARG ORAS_CHECKSUM_ARM=7649738b48fde10542bcc8b0e9b460ba83936c75fb5be01ee6d4443764a14352
2020

21+
# https://github.com/mikefarah/yq/releases
22+
ARG YQ_VERSION=v4.47.2
23+
ARG YQ_CHECKSUM=1bb99e1019e23de33c7e6afc23e93dad72aad6cf2cb03c797f068ea79814ddb0
24+
ARG YQ_CHECKSUM_ARM=05df1f6aed334f223bb3e6a967db259f7185e33650c3b6447625e16fea0ed31f
25+
2126
USER root
2227

2328
RUN mkdir -p "/tmp/local/bin" "/tmp/local/lib"
@@ -63,6 +68,19 @@ curl -fsSL --proto '=https' --tlsv1.2 "https://github.com/oras-project/oras/rele
6368
&& tar -xvf "/tmp/oras.tar.gz" --no-same-permissions --no-same-owner -C "/tmp" \
6469
&& install -o "root" -g "root" -m "0755" "/tmp/oras" "/tmp/local/bin/oras"
6570

71+
RUN case "${TARGETARCH}" in \
72+
'amd64') \
73+
checksum="${YQ_CHECKSUM}"; \
74+
;; \
75+
'arm64') \
76+
checksum="${YQ_CHECKSUM_ARM}"; \
77+
;; \
78+
*) echo >&2 "error: unsupported architecture ($TARGETARCH)"; exit 1; ;; \
79+
esac; \
80+
curl -fsSL --proto '=https' --tlsv1.2 "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH}" -o "/tmp/yq" \
81+
&& echo "${checksum} /tmp/yq" | sha256sum -c \
82+
&& install -o "root" -g "root" -m "0755" "/tmp/yq" "/tmp/local/bin/yq"
83+
6684
COPY ./base_helpers.sh /tmp/local/lib
6785

6886
FROM docker.io/library/debian:bookworm-slim
@@ -77,6 +95,7 @@ RUN apt-get update && apt-get upgrade --assume-yes && apt-get install --assume-y
7795
gnupg \
7896
jq \
7997
tar \
98+
tzdata \
8099
wget \
81100
&& apt-get autoremove --assume-yes \
82101
&& rm -rf /var/lib/apt/lists/*

containers/base/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This image is based on Debian OS and include the following packages:
1919
- oras
2020
- syft
2121
- wget
22+
- yq
2223

2324
Except for cosing and syft all the packages installed are the latest versions available during the image build,
2425
for cosign and syft we pin the versions to download, but we will strive to keep them updated to the latests

0 commit comments

Comments
 (0)