From 7f2a604f783311737cc9ae390746cc626696e037 Mon Sep 17 00:00:00 2001 From: JP Lomas Date: Tue, 3 Sep 2024 10:59:23 -0400 Subject: [PATCH] Fix build order (#88) * Fix build order If actionlint is built as per previous commit, it means git / python3 is not available for the rest of the in-progress basic.yml tests Signed-off-by: JP Lomas * Correct path of AL build Signed-off-by: JP Lomas --------- Signed-off-by: JP Lomas --- ubuntu-latest/Dockerfile | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ubuntu-latest/Dockerfile b/ubuntu-latest/Dockerfile index 207b441..f07656f 100644 --- a/ubuntu-latest/Dockerfile +++ b/ubuntu-latest/Dockerfile @@ -1,6 +1,21 @@ -FROM ubuntu:latest +FROM ubuntu:latest as base LABEL version="2" +# actionlint - for GitHub workflow file validation +# (version pinned to commit hash of v1.7.1) +FROM golang:1.23 as build +RUN mkdir /app +WORKDIR /app +ENV CGO_ENABLED 0 +RUN git clone https://github.com/rhysd/actionlint.git +WORKDIR /app/actionlint +RUN git reset --hard 62dc61a +RUN go build -o /usr/local/bin/actionlint ./cmd/actionlint +# copy built binary from build stage to final image +FROM ubuntu:latest +WORKDIR /root +COPY --from=build /usr/local/bin/actionlint /usr/local/bin/actionlint + RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Zurich && \ ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ echo $TZ > /etc/timezone && \ @@ -58,19 +73,5 @@ RUN opam init --yes --auto-setup && opam install --confirm-level=unsafe-yes --de # install ajv for CBOM validation RUN npm -g install ajv ajv-cli -# actionlint - for GitHub workflow file validation -# (version pinned to commit hash of v1.7.1) -FROM golang:1.23 AS build -RUN mkdir /app -WORKDIR /app -ENV CGO_ENABLED 0 -RUN git clone https://github.com/rhysd/actionlint.git -WORKDIR /app/actionlint -RUN git reset --hard 62dc61a -RUN go build -o /usr/local/bin/actionlint ./cmd/actionlint -# copy built binary from build stage to final image -FROM ubuntu:latest -COPY --from=build /usr/local/bin/actionlint /usr/local/bin/actionlint - # Activate if we want to test specific OpenSSL3 versions: -# RUN cd /root && git clone --depth 1 --branch openssl-3.0.7 https://github.com/openssl/openssl.git && cd openssl && LDFLAGS="-Wl,-rpath -Wl,/usr/local/openssl3/lib64" ./config --prefix=/usr/local/openssl3 && make -j && make install +# RUN cd /root && git clone --depth 1 --branch openssl-3.0.7 https://github.com/openssl/openssl.git && cd openssl && LDFLAGS="-Wl,-rpath -Wl,/usr/local/openssl3/lib64" ./config --prefix=/usr/local/openssl3 && make -j && make install \ No newline at end of file