From 2bb8c29409db8900a6483116c385d7c72c172352 Mon Sep 17 00:00:00 2001 From: vinkj1 Date: Wed, 30 Nov 2022 15:28:01 +0100 Subject: [PATCH 1/3] AI-566:BUG: Change directory where requirements are placed --- {{ cookiecutter.repo_name }}/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.repo_name }}/Dockerfile b/{{ cookiecutter.repo_name }}/Dockerfile index c235bd67e..0b15684dd 100644 --- a/{{ cookiecutter.repo_name }}/Dockerfile +++ b/{{ cookiecutter.repo_name }}/Dockerfile @@ -15,8 +15,8 @@ ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.d ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2(1).crt /tmp/vgc_issuing1_2.der -COPY requirements.txt {% if cookiecutter.image != 'R' %} setup.py {% endif %} ./ -RUN pip install -r requirements.txt \ +COPY requirements.txt {% if cookiecutter.image != 'R' %} setup.py {% endif %} /tmp/ +RUN pip install -r /tmp/requirements.txt \ && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt \ From d441260a8824c9f6aefdc55833d71ecc2f242e8d Mon Sep 17 00:00:00 2001 From: vinkj1 Date: Thu, 1 Dec 2022 10:35:49 +0100 Subject: [PATCH 2/3] Remove artifact files after build process --- {{ cookiecutter.repo_name }}/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/{{ cookiecutter.repo_name }}/Dockerfile b/{{ cookiecutter.repo_name }}/Dockerfile index 0b15684dd..91908b848 100644 --- a/{{ cookiecutter.repo_name }}/Dockerfile +++ b/{{ cookiecutter.repo_name }}/Dockerfile @@ -15,13 +15,14 @@ ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.d ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2(1).crt /tmp/vgc_issuing1_2.der -COPY requirements.txt {% if cookiecutter.image != 'R' %} setup.py {% endif %} /tmp/ -RUN pip install -r /tmp/requirements.txt \ +COPY requirements.txt {% if cookiecutter.image != 'R' %} setup.py {% endif %} ./ +RUN pip install -r requirements.txt \ && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt \ - && update-ca-certificates + && update-ca-certificates \ + && rm requirements.txt setup.py USER researcher WORKDIR /workspace \ No newline at end of file From 02c8e9ac95aa51865197a5ef0ba768af43f4d5f3 Mon Sep 17 00:00:00 2001 From: vinkj1 Date: Thu, 1 Dec 2022 10:57:15 +0100 Subject: [PATCH 3/3] AI-566: Add --no-cache-dir to pip install in Dockerfile --- {{ cookiecutter.repo_name }}/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.repo_name }}/Dockerfile b/{{ cookiecutter.repo_name }}/Dockerfile index 91908b848..aab2aac1a 100644 --- a/{{ cookiecutter.repo_name }}/Dockerfile +++ b/{{ cookiecutter.repo_name }}/Dockerfile @@ -16,7 +16,7 @@ ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.d ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2(1).crt /tmp/vgc_issuing1_2.der COPY requirements.txt {% if cookiecutter.image != 'R' %} setup.py {% endif %} ./ -RUN pip install -r requirements.txt \ +RUN pip install -r requirements.txt --no-cache-dir \ && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt \