-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathDockerfile-CI-CD
33 lines (28 loc) · 1.32 KB
/
Dockerfile-CI-CD
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
#-------------------------------------------------------------------------------
# To avoid rate limit issues with GitLab and DockerHub, push the CI-CD image to GHCR.
# Current GHCR limit:
# - 100 pulls per 6 hours per IP address for anonymous users.
# - Unlimited pulls for users authenticated with a GitHub account and a valid PAT
#
# Commands to build and push:
#
# docker buildx create --use
# docker buildx build --platform linux/amd64,linux/arm64 -t ghcr.io/rnacentral/ci-cd:3.20-alpine -f Dockerfile-CI-CD --push .
#
#-------------------------------------------------------------------------------
# Build container with kubectl and helm to be used by GitLab CI/CD
FROM arm64v8/alpine:3.14
ARG TARGETOS
ARG TARGETARCH
# Use kubectl version v1.23.8 and helm version v3.16.1
RUN apk -U upgrade \
&& apk add --no-cache ca-certificates bash git openssh curl gettext jq \
&& wget -q https://dl.k8s.io/release/v1.23.8/bin/${TARGETOS}/${TARGETARCH}/kubectl -O /usr/local/bin/kubectl \
&& wget -q https://get.helm.sh/helm-v3.16.1-${TARGETOS}-${TARGETARCH}.tar.gz -O - | tar -xzO ${TARGETOS}-${TARGETARCH}/helm > /usr/local/bin/helm \
&& chmod +x /usr/local/bin/helm /usr/local/bin/kubectl \
&& mkdir /config \
&& chmod g+rwx /config /root \
&& kubectl version --client \
&& helm version
WORKDIR /config
CMD bash