Skip to content

Commit

Permalink
make alpine version
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Jul 7, 2022
1 parent 5ea5d5d commit afa9787
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: nipreps-bot
username: cneuromod-bot
password: ${{ secrets.NIPREPS_BOT_PACKAGES }}

- name: Extract metadata (tags, labels) for Docker
Expand Down
60 changes: 7 additions & 53 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,61 +1,15 @@
# 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.

# Use Ubuntu 20.04 LTS
FROM ubuntu:focal-20210416

ENV LANG="C.UTF-8" \
LC_ALL="C.UTF-8"
FROM python:3.8-slim

# Prepare environment
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-utils \
ca-certificates \
curl \
netbase \
vim && \
curl bzip2 git && \
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
ENV GIT_ANNEX_PACKAGE=git-annex-10.20220505-nodep_h1234567_0.tar.bz2

RUN pip install datalad-osf
RUN cd /usr/ && \
curl -sSL https://anaconda.org/conda-forge/git-annex/10.20220505/download/linux-64/$GIT_ANNEX_PACKAGE | \
tar -xj

RUN pip install datalad pytest ssh_agent_setup
10 changes: 10 additions & 0 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.8-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
COPY --from=builder /usr/local /usr/local

RUN apk update && apk add --no-cache git openssh-client git-annex

0 comments on commit afa9787

Please sign in to comment.