-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG CHOCOLATEY_VERSION="1.1.0" | ||
ARG CHOCOLATEY_VERSION="1.3.1" | ||
ARG MONO_VERSION="6.12" | ||
ARG ALPINE_VERSION="3.16" | ||
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 | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
gzip \ | ||
tar \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ENV ChocolateyInstall="/opt/chocolatey" | ||
ARG CHOCOLATEY_VERSION | ||
WORKDIR /usr/local/src | ||
RUN wget "https://github.com/chocolatey/choco/archive/${CHOCOLATEY_VERSION}.tar.gz" \ | ||
&& tar -xzf "${CHOCOLATEY_VERSION}.tar.gz" \ | ||
&& mv choco-${CHOCOLATEY_VERSION} choco | ||
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 | ||
|
||
ENV ChocolateyInstall="/opt/chocolatey" | ||
COPY --from=src /src /usr/local/src/choco | ||
WORKDIR /usr/local/src/choco | ||
RUN chmod +x build.sh zip.sh | ||
RUN ./build.sh | ||
RUN ./build.sh --verbosity=diagnostic | ||
|
||
FROM alpine:${ALPINE_VERSION} | ||
LABEL maintainer="CrazyMax" | ||
|
||
COPY --from=builder /usr/local/src/choco/build_output/chocolatey /opt/chocolatey | ||
|
||
COPY --from=builder /usr/local/src/choco/code_drop/temp/_PublishedApps/choco /opt/chocolatey | ||
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 \ | ||
&& ln -sf /opt /opt/chocolatey/opt \ | ||
&& mkdir -p /opt/chocolatey/lib \ | ||
&& apk del build-dependencies \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
COPY entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] |