From 4cf6a0c9eeca1b15c1f437fc057fad24b8e1d370 Mon Sep 17 00:00:00 2001 From: Gabriel <93184896+Schiggy-3000@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:27:12 +0200 Subject: [PATCH 1/2] Handle images created on windows machines --- dockerfiles/Dockerfile.debian | 7 +++++++ dockerfiles/Dockerfile.debian.escu | 7 +++++++ dockerfiles/Dockerfile.debian.rapids | 7 +++++++ dockerfiles/Dockerfile.debian.spark | 7 +++++++ dockerfiles/Dockerfile.debian.transformers | 7 +++++++ dockerfiles/Dockerfile.redhat | 7 +++++++ 6 files changed, 42 insertions(+) diff --git a/dockerfiles/Dockerfile.debian b/dockerfiles/Dockerfile.debian index 3af0e36..79253f1 100644 --- a/dockerfiles/Dockerfile.debian +++ b/dockerfiles/Dockerfile.debian @@ -51,6 +51,13 @@ COPY ./bootstrap_scripts/bootstrap_fast.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # Install local DSDL supporting functions RUN mkdir /dltk/packages COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz diff --git a/dockerfiles/Dockerfile.debian.escu b/dockerfiles/Dockerfile.debian.escu index 16915af..fac4486 100644 --- a/dockerfiles/Dockerfile.debian.escu +++ b/dockerfiles/Dockerfile.debian.escu @@ -50,6 +50,13 @@ COPY ./bootstrap_scripts/bootstrap_fast.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # Install local DSDL supporting functions RUN mkdir /dltk/packages COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz diff --git a/dockerfiles/Dockerfile.debian.rapids b/dockerfiles/Dockerfile.debian.rapids index 3e409c0..c0a2049 100644 --- a/dockerfiles/Dockerfile.debian.rapids +++ b/dockerfiles/Dockerfile.debian.rapids @@ -48,6 +48,13 @@ COPY bootstrap_scripts/bootstrap_rapids.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # Install local DSDL supporting functions RUN mkdir /dltk/packages COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz diff --git a/dockerfiles/Dockerfile.debian.spark b/dockerfiles/Dockerfile.debian.spark index 098538b..e8fa468 100644 --- a/dockerfiles/Dockerfile.debian.spark +++ b/dockerfiles/Dockerfile.debian.spark @@ -53,6 +53,13 @@ COPY ./bootstrap_scripts/bootstrap_fast.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # Install local DSDL supporting functions RUN mkdir /dltk/packages COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz diff --git a/dockerfiles/Dockerfile.debian.transformers b/dockerfiles/Dockerfile.debian.transformers index e8967a2..7d1b85b 100644 --- a/dockerfiles/Dockerfile.debian.transformers +++ b/dockerfiles/Dockerfile.debian.transformers @@ -45,6 +45,13 @@ COPY ./bootstrap_scripts/bootstrap_transformers.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # copy and expand transformer content ADD basemodels/class_en.tar.gz /dltk/app/model/data/classification/en ADD basemodels/class_jp.tar.gz /dltk/app/model/data/classification/jp diff --git a/dockerfiles/Dockerfile.redhat b/dockerfiles/Dockerfile.redhat index ba14f7a..437557e 100644 --- a/dockerfiles/Dockerfile.redhat +++ b/dockerfiles/Dockerfile.redhat @@ -50,6 +50,13 @@ COPY ./bootstrap_scripts/bootstrap_fast.sh /dltk/ COPY app /dltk/app COPY notebooks /dltk/notebooks +# Install dos2unix, then convert windows-like line endings to linux-like +# The bootstrap script won't run otherwise if the image was build on a windows machine +# Finally, remove dos2unix again +RUN apt-get update && apt-get install -y dos2unix +RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; +RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* + # Install local DSDL supporting functions RUN mkdir /dltk/packages COPY package-dsdlsupport/dist/dsdlsupport-1.0.0.tar.gz /dltk/packages/dsdlsupport-1.0.0.tar.gz From 813e063e4b28a19a809907c870dd72d79da9febc Mon Sep 17 00:00:00 2001 From: Gabriel <93184896+Schiggy-3000@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:58:01 +0200 Subject: [PATCH 2/2] updated Debian.redhat file --- dockerfiles/Dockerfile.redhat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/Dockerfile.redhat b/dockerfiles/Dockerfile.redhat index 437557e..462447c 100644 --- a/dockerfiles/Dockerfile.redhat +++ b/dockerfiles/Dockerfile.redhat @@ -53,9 +53,9 @@ COPY notebooks /dltk/notebooks # Install dos2unix, then convert windows-like line endings to linux-like # The bootstrap script won't run otherwise if the image was build on a windows machine # Finally, remove dos2unix again -RUN apt-get update && apt-get install -y dos2unix +RUN yum install -y dos2unix RUN find /dltk/ -name 'bootstrap_*.sh' -type f -exec dos2unix {} \; -RUN apt-get --purge remove -y dos2unix && rm -rf /var/lib/apt/lists/* +RUN yum remove -y dos2unix && yum clean all # Install local DSDL supporting functions RUN mkdir /dltk/packages