-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (30 loc) · 1.65 KB
/
Dockerfile
File metadata and controls
45 lines (30 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# SPDX-License-Identifier: Apache-2.0
# set a global Docker argument for the default CLI version
#
# https://github.com/moby/moby/issues/37345
# renovate: datasource=github-tags depName=cli/cli extractVersion=^v(?<version>.*)$
ARG GH_VERSION=2.87.3
###################################################################################
## docker build --no-cache --target binary -t vela-github-release:binary . ##
###################################################################################
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 as binary
ARG GH_VERSION
ENV GH_RELEASE_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}"
ENV GH_FILENAME="gh_${GH_VERSION}_linux_amd64.tar.gz"
ENV GH_CHECKSUM_FILENAME="gh_${GH_VERSION}_checksums.txt"
RUN wget -q "${GH_RELEASE_URL}/${GH_FILENAME}" -O "${GH_FILENAME}" && \
wget -q "${GH_RELEASE_URL}/${GH_CHECKSUM_FILENAME}" -O "${GH_CHECKSUM_FILENAME}" && \
grep "${GH_FILENAME}" "${GH_CHECKSUM_FILENAME}" | sha256sum -c && \
tar -xf "${GH_FILENAME}" && \
mv "${GH_FILENAME%.tar.gz}/bin/gh" /bin/gh && \
chmod 0700 /bin/gh
##################################################################
## docker build --no-cache -t vela-github-release:local . ##
##################################################################
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659
ARG GH_VERSION
ENV PLUGIN_GH_VERSION=${GH_VERSION}
RUN apk add --update --no-cache git ca-certificates
COPY --from=binary /bin/gh /bin/gh
COPY release/vela-github-release /bin/vela-github-release
ENTRYPOINT [ "/bin/vela-github-release" ]