Skip to content

Commit

Permalink
Fixed downloading of yq
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Gallucci committed Feb 24, 2021
1 parent d25991d commit 9fec535
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
FROM alpine as curl

WORKDIR /

RUN apk add curl

FROM curl as yq-downloader

ARG OS=${TARGETOS:-linux}
ARG ARCH=${TARGETARCH:-amd64}
ARG YQ_VERSION="v4.4.1"
ARG YQ_BINARY="yq_${OS}_$ARCH"
RUN curl "https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/$YQ_BINARY" -o /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq

FROM ubuntu:focal

RUN apt-get update && \
Expand All @@ -16,13 +31,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
xmlstarlet \
&& rm -rf /var/lib/apt/lists/*

ARG OS=${TARGETOS:-linux}
ARG ARCH=${TARGETARCH:-amd64}
ARG YQ_VERSION="v4.6.0"
ARG YQ_BINARY="yq_${OS}_$ARCH"
RUN wget "https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/$YQ_BINARY" -O /usr/local/bin/yq && \
chmod +x /usr/local/bin/yq

WORKDIR /app

COPY dep-bootstrap.sh .
Expand All @@ -33,6 +41,8 @@ RUN mkdir -p /home/jenkins
RUN chown 1000:1000 /home/jenkins
ENV JENKINS_USER=jenkins

COPY --from=yq-downloader --chown=1000:1000 /usr/local/bin/yq /usr/local/bin/yq

USER 1000

RUN ./dep-bootstrap.sh 0.4.1 install
Expand Down

0 comments on commit 9fec535

Please sign in to comment.