Skip to content

Commit

Permalink
DOCKER: Build wheel and install in two-stage build
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Sep 27, 2022
1 parent ac44a3a commit cf778a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 34 deletions.
28 changes: 0 additions & 28 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,3 @@ fmriprep.egg-info/**/*
fmriprep.egg-info
.eggs/**/*
.eggs

# housekeeping tools
get_version.py
update_changes.sh
tox.ini

# pip installs
src/**/*
src/

# git
.gitignore
.git/**/*
.git

# other
work/**/*
work
out/**/*
out/

# CI, etc.
.circleci
.circleci/**/*
.zenodo.json
.travis.yml
.readthedocs.yml
CONTRIBUTING.md
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

FROM python:slim AS src
RUN pip install build
RUN apt-get update && \
apt-get install -y --no-install-recommends git
COPY . /src/fmriprep
RUN python -m build /src/fmriprep

# Use Ubuntu 20.04 LTS
FROM ubuntu:focal-20210416

Expand Down Expand Up @@ -283,12 +290,8 @@ RUN /opt/conda/bin/python fetch_templates.py && \
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +

# Installing FMRIPREP
COPY . /src/fmriprep
ARG VERSION
# Force static versioning within container
RUN echo "${VERSION}" > /src/fmriprep/fmriprep/VERSION && \
echo "include fmriprep/VERSION" >> /src/fmriprep/MANIFEST.in && \
/opt/conda/bin/python -m pip install --no-cache-dir "/src/fmriprep[all]"
COPY --from=src /src/fmriprep/dist/*.whl .
RUN /opt/conda/bin/python -m pip install --no-cache-dir $( ls *.whl )[all]

RUN find $HOME -type d -exec chmod go=u {} + && \
find $HOME -type f -exec chmod go=u {} + && \
Expand Down

0 comments on commit cf778a9

Please sign in to comment.