Skip to content

Commit 6ebcac3

Browse files
author
Ryan
authored
ci(choco): fix chocolatey docker build (#903)
Signed-off-by: hackercat <[email protected]>
1 parent 8ad6c07 commit 6ebcac3

File tree

2 files changed

+10
-27
lines changed

2 files changed

+10
-27
lines changed

.github/actions/choco/Dockerfile

+9-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,19 @@
1-
# choco supports only Mono 5.20.x
2-
# https://github.com/chocolatey/choco#prerequisites
3-
FROM mono:5.20 as builder
4-
# 0.10.15 with newer Mono is failing as it's dependent on Mono Profile 4.0 which has been deprecated
5-
# http://www.mono-project.com/docs/about-mono/releases/4.0.0/#dropped-support-for-old-frameworks
6-
# Alternative to consider, use git repository and reset to specific tag/hash
7-
ARG CHOCOVERSION=0.10.16-beta
8-
9-
ENV DEBIAN_FRONTEND=noninteractive
10-
RUN apt-get update && apt-get install -y wget tar gzip
11-
12-
WORKDIR /usr/local/src
13-
RUN wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz"
14-
RUN tar -xzf "${CHOCOVERSION}.tar.gz"
15-
RUN mv "choco-${CHOCOVERSION}" choco
16-
17-
WORKDIR /usr/local/src/choco
18-
RUN chmod +x build.sh zip.sh
19-
RUN ./build.sh -v
20-
211
FROM alpine:latest
222

23-
COPY --from=builder /usr/local/src/choco/build_output/chocolatey /opt/chocolatey
3+
ARG CHOCOVERSION=0.11.3
244

25-
RUN apk add --no-cache bash
26-
RUN apk --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \
27-
&& apk --update --no-cache add -t build-dependencies ca-certificates \
5+
RUN apk add --no-cache bash ca-certificates \
6+
&& apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \
287
&& cert-sync /etc/ssl/certs/ca-certificates.crt \
8+
&& wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz" \
9+
&& tar -xzf "${CHOCOVERSION}.tar.gz" \
10+
&& mv "choco-${CHOCOVERSION}" /opt/chocolatey \
11+
&& chmod +x build.sh zip.sh \
12+
&& ./build.sh -v \
2913
&& ln -sf /opt /opt/chocolatey/opt \
3014
&& mkdir -p /opt/chocolatey/lib \
31-
&& apk del build-dependencies \
15+
&& apk del ca-certificates \
3216
&& rm -rf /var/cache/apk/*
3317

34-
3518
COPY entrypoint.sh /entrypoint.sh
3619
ENTRYPOINT ["/entrypoint.sh"]

.github/actions/choco/entrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
function choco {
6-
mono /opt/chocolatey/choco.exe "$@" --allow-unofficial --nocolor
6+
mono /opt/chocolatey/code_drop/chocolatey/choco.exe "$@" --allow-unofficial --nocolor
77
}
88

99
function get_version {

0 commit comments

Comments
 (0)