From c58640840c4427f9c7113ddfdf3ee146a2d1ec70 Mon Sep 17 00:00:00 2001 From: cneuromod_bot Date: Thu, 30 Jan 2025 09:26:58 -0500 Subject: [PATCH 1/2] update actions and update/optimize docker image --- .github/workflows/docker-build.yml | 8 ++++---- Dockerfile | 17 ++++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 17e7b81..8d4dcf0 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -22,10 +22,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v3.3.0 with: registry: ${{ env.REGISTRY }} username: nipreps-bot @@ -33,12 +33,12 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5.6.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + uses: docker/build-push-action@v6.13.0 with: context: . push: true diff --git a/Dockerfile b/Dockerfile index 8cc2341..8a13715 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,13 +20,16 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -FROM python:3.11-alpine as builder +FROM python:3.12-alpine AS builder -RUN apk update && apk add --no-cache curl bzip2 gcc libffi-dev musl-dev +RUN apk add --no-cache curl bzip2 gcc libffi-dev musl-dev +RUN pip install --no-cache-dir virtualenv +RUN virtualenv /opt/venv && source /opt/venv/bin/activate && \ + python -m pip install --no-cache-dir datalad pytest ssh_agent_setup && \ + python -m pip uninstall -y pip # save 10MB -RUN python -m pip install --no-cache-dir datalad pytest ssh_agent_setup +FROM python:3.12-alpine +RUN apk add --no-cache git openssh-client git-annex +COPY --from=builder /opt/venv /opt/venv -FROM python:3.11-alpine -COPY --from=builder /usr/local /usr/local - -RUN apk update && apk add --no-cache git openssh-client git-annex +ENV PATH=$PATH:/opt/venv/bin From f0f96f4259732875d8faf015e7dc6273f15f3b52 Mon Sep 17 00:00:00 2001 From: cneuromod_bot Date: Thu, 30 Jan 2025 12:09:13 -0500 Subject: [PATCH 2/2] revert, to many things breaking --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a13715..9290cff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,8 +25,7 @@ FROM python:3.12-alpine AS builder RUN apk add --no-cache curl bzip2 gcc libffi-dev musl-dev RUN pip install --no-cache-dir virtualenv RUN virtualenv /opt/venv && source /opt/venv/bin/activate && \ - python -m pip install --no-cache-dir datalad pytest ssh_agent_setup && \ - python -m pip uninstall -y pip # save 10MB + python -m pip install --no-cache-dir datalad pytest ssh_agent_setup FROM python:3.12-alpine RUN apk add --no-cache git openssh-client git-annex