Add docker images #5

Merged
allanger merged 21 commits from refs/pull/5/head into main 2023-02-14 21:16:34 +00:00
12 changed files with 61 additions and 0 deletions
Showing only changes of commit 9e23345df9 - Show all commits

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
target

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM rust:1.66.1-alpine3.17 as builder
WORKDIR /src
RUN apk update && apk add --no-cache gcc musl-dev
COPY ./ .
RUN cargo build --release
FROM alpine:3.17.1
COPY --from=builder /src/target/release/cdh /bin/cdh
WORKDIR /workdir
ENTRYPOINT ["/bin/cdh"]

16
Dockerfile-helmfile Normal file
View File

@ -0,0 +1,16 @@
FROM alpine:3.17.1
ARG HELM_VERSION=3.10.3
ARG HELMFILE_VERSION=0.150.0
ARG HELM_LINK=https://get.helm.sh/helm-v$HELM_VERSION-linux-$PLATFORM.tar.gz
ARG HELMFILE_LINK=https://github.com/helmfile/helmfile/releases/download/v$HELMFILE_VERSION/helmfile_$HELMFILE_VERSION_linux_\$PLATFORM.tar.gz
RUN apk update && apk add --no-cache curl
COPY ./scripts /tmp
RUN echo "installing helm from ${HELM_LINK}"
ENV HELM_ARCHIVE_PATH=/tmp/helm.tar.gz
RUN /tmp/download_for_arch.sh $HELM_LINK $HELM_ARCHIVE_PATH
RUN tar -zxvf $HELM_ARCHIVE_PATH
RUN echo $HELMFILE_LINK
CMD ["sh"]

2
Makefile Normal file
View File

@ -0,0 +1,2 @@
build:
cargo build --release

View File

View File

View File

View File

View File

@ -0,0 +1,16 @@
FROM alpine:3.17.1
ARG HELM_VERSION=3.10.3
ARG HELMFILE_VERSION=0.150.0
ARG HELM_LINK=https://get.helm.sh/helm-v$HELM_VERSION-linux-\$PLATFORM.tar.gz
ARG HELMFILE_LINK=https://github.com/helmfile/helmfile/releases/download/v$HELMFILE_VERSION/helmfile_$HELMFILE_VERSION_linux_\$PLATFORM.tar.gz
RUN apk update && apk add --no-cache curl
RUN echo "installing helm from ${HELM_LINK}"
ENV HELM_ARCHIVE_PATH=/tmp/helm.tar.gz
RUN curl -LJO $HELM $HELM_ARCHIVE_PATH
RUN tar -zxvf $HELM_ARCHIVE_PATH
RUN echo $HELMFILE_LINK
CMD ["sh"]

View File

View File

15
scripts/download_for_arch.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
case $(uname -m) in
"arm64"|"aarch64")
PLATFORM="arm64"
;;
"x86_64")
PLATFORM="amd64"
;;
*)
echo "Unsuported target"
exit 1
;;
esac
echo "Downloading $2 from $1"
curl -LJO $1 $2