From 1f6da96c4dbe60ee60c907b2ef8891623de8366b Mon Sep 17 00:00:00 2001 From: Usman Akinyemi Date: Mon, 21 Oct 2024 07:31:06 +0000 Subject: [PATCH] Remove pushing of the image and used slim instead of alpine --- .github/workflows/docker-build-and-run.yml | 4 ---- Docker/Dockerfile | 16 +++++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker-build-and-run.yml b/.github/workflows/docker-build-and-run.yml index 1c30ed2..202c6c3 100644 --- a/.github/workflows/docker-build-and-run.yml +++ b/.github/workflows/docker-build-and-run.yml @@ -46,10 +46,6 @@ jobs: run: | docker build -t tf2.4_ivim-mri_codecollection -f Docker/Dockerfile . - - name: Save and compress Docker image - run: | - docker save tf2.4_ivim-mri_codecollection | gzip > tf2.4_ivim-mri_codecollection.tar.gz - - name: Run Docker container run: | docker run --rm --name TF2.4_IVIM-MRI_CodeCollection \ diff --git a/Docker/Dockerfile b/Docker/Dockerfile index 275134e..a5537f9 100644 --- a/Docker/Dockerfile +++ b/Docker/Dockerfile @@ -1,19 +1,17 @@ -FROM python:3.11-alpine +FROM python:3.11-slim WORKDIR /usr/src/app -# Install build tools and necessary libraries on Alpine -RUN apk add --no-cache \ - build-base \ - libssl3 \ - openssl-dev +RUN apt-get update && apt-get install -y --no-install-recommends \ + build-essential \ + libssl-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* -# Copy and install Python dependencies COPY ../requirements.txt ./ + RUN pip install --no-cache-dir -r requirements.txt -# Copy the rest of the application COPY .. . -# Define the entry point ENTRYPOINT ["python3", "-m", "WrapImage.nifti_wrapper"]