From f6b7492c62374ebd445c8cba36a0917d31f24429 Mon Sep 17 00:00:00 2001 From: regg00 Date: Fri, 7 Jul 2023 07:40:43 -0400 Subject: [PATCH 1/2] image: download binaries from github releases --- image/Dockerfile | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/image/Dockerfile b/image/Dockerfile index 60d444f..99f6bff 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -1,34 +1,15 @@ # syntax=docker/dockerfile:1 -ARG CHOCOLATEY_VERSION="1.3.1" -ARG MONO_VERSION="6.12" +ARG CHOCOLATEY_VERSION="2.1.0" ARG ALPINE_VERSION="3.17" -FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} as src -RUN apk add --no-cache git -WORKDIR /src -ARG CHOCOLATEY_VERSION -RUN git clone --branch ${CHOCOLATEY_VERSION} "https://github.com/chocolatey/choco.git" . - -FROM mono:${MONO_VERSION} as builder -ARG DEBIAN_FRONTEND=noninteractive -RUN curl -o packages-microsoft-prod.deb https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb \ - && dpkg -i packages-microsoft-prod.deb \ - && apt-get update \ - && apt-get install -y dotnet-sdk-6.0 -RUN echo deb http://deb.debian.org/debian buster-backports main | tee /etc/apt/sources.list.d/buster-backports.list \ - && apt-get update \ - && apt-get install -y -t buster-backports git +FROM alpine:${ALPINE_VERSION} -ENV ChocolateyInstall="/opt/chocolatey" -COPY --from=src /src /usr/local/src/choco -WORKDIR /usr/local/src/choco -RUN ./build.sh --verbosity=diagnostic +WORKDIR /opt/chocolatey -FROM alpine:${ALPINE_VERSION} -COPY --from=builder /usr/local/src/choco/code_drop/temp/_PublishedApps/choco /opt/chocolatey +RUN apk add --no-cache curl RUN apk --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \ && apk --update --no-cache add -t build-dependencies ca-certificates \ && cert-sync /etc/ssl/certs/ca-certificates.crt \ @@ -36,5 +17,10 @@ RUN apk --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/e && mkdir -p /opt/chocolatey/lib \ && apk del build-dependencies \ && rm -rf /var/cache/apk/* + +ARG CHOCOLATEY_VERSION + +RUN curl -sSL "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar xz + COPY entrypoint.sh / ENTRYPOINT [ "/entrypoint.sh" ] From 6c3efe2c23f448bd19b97448e8a5cb910581c89b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 31 Aug 2023 11:31:33 +0200 Subject: [PATCH 2/2] image: update to v2.2.2 and dockerfile optim --- image/Dockerfile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/image/Dockerfile b/image/Dockerfile index 99f6bff..f556f47 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -1,17 +1,13 @@ # syntax=docker/dockerfile:1 -ARG CHOCOLATEY_VERSION="2.1.0" +ARG CHOCOLATEY_VERSION="2.2.2" ARG ALPINE_VERSION="3.17" - - FROM alpine:${ALPINE_VERSION} - WORKDIR /opt/chocolatey - -RUN apk add --no-cache curl -RUN apk --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \ - && apk --update --no-cache add -t build-dependencies ca-certificates \ +RUN apk --update --repository https://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \ + && apk add --no-cache curl \ + && apk add -t build-dependencies ca-certificates \ && cert-sync /etc/ssl/certs/ca-certificates.crt \ && ln -sf /opt /opt/chocolatey/opt \ && mkdir -p /opt/chocolatey/lib \ @@ -19,7 +15,6 @@ RUN apk --update --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/e && rm -rf /var/cache/apk/* ARG CHOCOLATEY_VERSION - RUN curl -sSL "https://github.com/chocolatey/choco/releases/download/${CHOCOLATEY_VERSION}/chocolatey.v${CHOCOLATEY_VERSION}.tar.gz" | tar xz COPY entrypoint.sh /