From 77b32f2756fd61dd2b76552cb54f8a410744bed1 Mon Sep 17 00:00:00 2001 From: yosi-codefresh Date: Tue, 29 Aug 2023 13:31:41 +0300 Subject: [PATCH] Cr security cloner 1 (#67) * fix security vulnerabilities --- Dockerfile | 34 +++++++++++++++++++++++++++++----- service.yaml | 2 +- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc75de7..9bbc527 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,36 @@ #moving to ubuntu instead of debian to solve high vulnerabilities -FROM ubuntu:jammy-20230425 +FROM ubuntu:jammy-20230804 -RUN apt-get update -y && apt-get install git bash openssl -y +RUN apt-get update && \ + apt-get install -y curl bash openssl git && \ + apt-get clean -RUN apt-get install git-lfs && \ - git lfs install +ARG GIT_LFS_VERSION=3.4.0 +ARG TARGETPLATFORM -RUN apt-get update -y && apt-get install busybox -y && ln -s /bin/busybox /usr/bin/[[ +# installing git-lfs +RUN case ${TARGETPLATFORM} in \ + "linux/amd64") OS_ARCH=amd64 ;; \ + "linux/arm64") OS_ARCH=arm64 ;; \ + esac \ + && curl -sL https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${OS_ARCH}-v${GIT_LFS_VERSION}.tar.gz -o "git-lfs.tar.gz" && \ + tar -xvzf "git-lfs.tar.gz" && \ + chmod +x git-lfs-${GIT_LFS_VERSION}/install.sh && \ + rm git-lfs.tar.gz && \ + git-lfs-${GIT_LFS_VERSION}/install.sh + +#installing busybox +ARG BUSYBOX_VERSION=1.31.0 + +RUN curl -sL https://busybox.net/downloads/binaries/${BUSYBOX_VERSION}-defconfig-multiarch-musl/busybox-x86_64 -o busybox && \ + ls -l busybox && \ + chmod +x busybox && \ + mv busybox /usr/bin/ && \ + ls /usr/bin/busybox && \ + busybox | head -n 1 + + +RUN ln -s /bin/busybox /usr/bin/[[ COPY ./start.sh /run/start.sh RUN chmod +x /run/start.sh diff --git a/service.yaml b/service.yaml index e71ba19..6832c07 100644 --- a/service.yaml +++ b/service.yaml @@ -1 +1 @@ -version: 10.1.21 +version: 10.1.22