Skip to content

Commit df35049

Browse files
authored
Merge pull request #210 from ANTsX/docker_with_data
CI: Add a docker image with data to releases
2 parents ad500f8 + 3daa22d commit df35049

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,33 @@ jobs:
5959
id: meta
6060
run: |
6161
# For a release-triggered workflow, GITHUB_REF_NAME is the tag name (e.g., v0.2.3)
62+
# but we strip the leading 'v' for the Docker tag (e.g., 0.2.3)
6263
echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
6364
64-
- name: Build and push
65+
- name: Build and push base image
6566
uses: docker/build-push-action@v6
6667
with:
6768
context: .
6869
file: ./docker/Dockerfile
6970
push: true
71+
cache-from: type=gha
72+
cache-to: type=gha,mode=max
7073
tags: |
7174
${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.tag }}
7275
${{ env.DOCKER_IMAGE }}:latest
7376
77+
- name: Build and push image with data
78+
uses: docker/build-push-action@v6
79+
with:
80+
context: .
81+
file: ./docker/add_data.dockerfile
82+
push: true
83+
cache-from: type=gha
84+
cache-to: type=gha,mode=max
85+
tags: |
86+
${{ env.DOCKER_IMAGE }}:${{ steps.meta.outputs.tag }}-with-data
87+
${{ env.DOCKER_IMAGE }}:latest-with-data
88+
7489
publish-pypi:
7590
name: Publish sdist to PyPI
7691
runs-on: ubuntu-latest

docker/add_data.dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM antsx/antspynet:latest
2+
3+
USER root
4+
WORKDIR /home/antspyuser
5+
6+
RUN . "${VIRTUAL_ENV}/bin/activate" && \
7+
/opt/bin/download_antsxnet_data.py \
8+
--cache-dir /home/antspyuser/.keras/ANTsXNet \
9+
--strict && \
10+
chmod -R 0755 /home/antspyuser/.antspy /home/antspyuser/.keras
11+
12+
USER antspyuser
13+
14+
LABEL maintainer="Philip A Cook (https://github.com/cookpa)" \
15+
description="ANTsPyNet is part of the ANTsX ecosystem (https://github.com/ANTsX). \
16+
ANTsX citation: https://pubmed.ncbi.nlm.nih.gov/33907199"
17+
ENTRYPOINT ["python"]

0 commit comments

Comments
 (0)