From 52bd17c65232580e2133a3f7cf08b4f30d5abc57 Mon Sep 17 00:00:00 2001 From: basile Date: Thu, 7 Jul 2022 10:59:58 -0400 Subject: [PATCH 1/5] make alpine version: 241MB instead of 947MB, includes pytest for writing tests using datalad API --- Dockerfile | 63 ++++++------------------------------------------------ 1 file changed, 6 insertions(+), 57 deletions(-) diff --git a/Dockerfile b/Dockerfile index ad19baa..8795281 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,61 +1,10 @@ -# MIT License -# -# Copyright (c) 2021 The NiPreps Developers -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. +FROM python:3.8-alpine as builder -# Use Ubuntu 20.04 LTS -FROM ubuntu:focal-20210416 +RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev -ENV LANG="C.UTF-8" \ - LC_ALL="C.UTF-8" +RUN pip install datalad pytest ssh_agent_setup -# Prepare environment -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - apt-utils \ - ca-certificates \ - curl \ - netbase \ - vim && \ - apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -ENV EDITOR=/usr/bin/vim - -# Installing and setting up miniconda -RUN curl -sSLO https://repo.continuum.io/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh && \ - bash Miniconda3-py38_4.10.3-Linux-x86_64.sh -b -p /opt/miniconda && \ - rm Miniconda3-py38_4.10.3-Linux-x86_64.sh - -# Set CPATH for packages relying on compiled libs (e.g. indexed_gzip) -ENV PATH="/opt/miniconda/bin:$PATH" \ - CPATH="/opt/miniconda/include:$CPATH" \ - PYTHONNOUSERSITE=1 - -RUN conda install -y -c conda-forge -c anaconda \ - datalad \ - git-annex \ - hub \ - jq \ - osfclient && \ - conda clean -y --all && sync && \ - rm -rf ~/.conda ~/.cache/pip/*; sync - -RUN pip install datalad-osf +FROM python:3.8-alpine +COPY --from=builder /usr/local /usr/local +RUN apk update && apk add --no-cache git openssh-client git-annex From ad2440d8f320fca5e67b481abbc88d7433fbe3db Mon Sep 17 00:00:00 2001 From: bpinsard Date: Tue, 9 Apr 2024 15:17:36 -0400 Subject: [PATCH 2/5] bump alpine-python --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8795281..2625d98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.8-alpine as builder +FROM python:3.11-alpine as builder RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev RUN pip install datalad pytest ssh_agent_setup -FROM python:3.8-alpine +FROM python:3.11-alpine COPY --from=builder /usr/local /usr/local RUN apk update && apk add --no-cache git openssh-client git-annex From 69bae0cd83a66f508030d5d9d4e9fbce8749fd33 Mon Sep 17 00:00:00 2001 From: Basile Date: Fri, 19 Apr 2024 14:13:43 -0400 Subject: [PATCH 3/5] Update Dockerfile Co-authored-by: Oscar Esteban --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2625d98..dae3f5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.11-alpine as builder RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev -RUN pip install datalad pytest ssh_agent_setup +RUN python -m pip install datalad pytest ssh_agent_setup FROM python:3.11-alpine COPY --from=builder /usr/local /usr/local From 273022d073a681bdf25ab8cd7e09fc91b1a65643 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Mon, 27 May 2024 09:18:33 -0400 Subject: [PATCH 4/5] fix LICENSE and license text embed in Dockerfile --- Dockerfile | 22 ++++++++++++++++++++++ LICENSE | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2625d98..5851007 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,25 @@ +# MIT License +# +# Copyright (c) The NiPreps Developers +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + FROM python:3.11-alpine as builder RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev diff --git a/LICENSE b/LICENSE index 7b364d5..ab7187f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 TemplateFlow +Copyright (c) The NiPreps Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From d260fc089aae2cb4d91c00cf90e3e000242a6565 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Mon, 27 May 2024 12:02:28 -0400 Subject: [PATCH 5/5] pip no-cache-dir --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5492e32..8cc2341 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ FROM python:3.11-alpine as builder RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev -RUN python -m pip install datalad pytest ssh_agent_setup +RUN python -m pip install --no-cache-dir datalad pytest ssh_agent_setup FROM python:3.11-alpine COPY --from=builder /usr/local /usr/local