Add python2 builder as well

- Uses virtualenv instead of venv
- Is ok for Dockerfiles to diverge, we keep assemble scripts the
  same
- Change name to account for venv + python version present
- Add a ugly hack to get some packages (tiffiles and others) to
  work properly when using sdists + py2
pull/6/head
yuvipanda 2017-05-09 01:32:45 -07:00
rodzic 5dc6fcec2b
commit 1d2e7adab9
4 zmienionych plików z 44 dodań i 9 usunięć

Wyświetl plik

@ -0,0 +1,34 @@
FROM ubuntu:16.10
MAINTAINER Yuvi Panda <yuvipanda@gmail.com>
LABEL io.openshift.s2i.scripts-url=image:///usr/libexec/s2i
ENV APP_DIR /srv/app
ENV PATH ${APP_DIR}/venv/bin:$PATH
RUN apt-get update && \
apt-get install --yes --no-install-recommends \
python \
python-dev \
build-essential \
virtualenv \
tar \
git && \
apt-get purge && apt-get clean
RUN adduser --disabled-password --gecos "Default Jupyter user" jovyan
RUN mkdir -p ${APP_DIR} && chown -R jovyan:jovyan ${APP_DIR}
WORKDIR /home/jovyan
USER jovyan
RUN virtualenv ${APP_DIR}/venv
RUN ${APP_DIR}/venv/bin/pip install --no-cache-dir notebook==5.0.0 git+https://github.com/yuvipanda/jupyterhub-legacy-singleuser@master ipywidgets==5.2.3 && \
${APP_DIR}/venv/bin/jupyter nbextension enable --py widgetsnbextension
COPY ./s2i/bin/ /usr/libexec/s2i
EXPOSE 8888

Wyświetl plik

@ -1,12 +1,7 @@
IMAGE_NAME = jupyterhub/singleuser-builder
IMAGE_PREFIX = jupyterhub/singleuser-builder-venv-
VERSION = $(shell cat version)
.PHONY: build
build:
docker build -t $(IMAGE_NAME):$(VERSION) .
.PHONY: test
test:
docker build -t $(IMAGE_NAME)-candidate:$(VERSION) .
IMAGE_NAME=$(IMAGE_NAME)-candidate:$(VERSION) test/run
docker build -t $(IMAGE_PREFIX)3.5:$(VERSION) . -f Dockerfile
docker build -t $(IMAGE_PREFIX)2.7:$(VERSION) . -f Dockerfile.py2

Wyświetl plik

@ -23,5 +23,11 @@ cp -Rf /tmp/src/. .
echo "---> Building application from source..."
if [ -f ${APP_DIR}/src/requirements.txt ]; then
# HACK: If numpy is present in requirements.txt, install it first!
# This is because some packages (tiffiles *cough*) need numpy to be fully installed
# for their setup.py to work, and this... causes all sorts of problems.
if grep --quiet numpy ${APP_DIR}/src/requirements.txt; then
${APP_DIR}/venv/bin/pip install $(grep numpy ${APP_DIR}/src/requirements.txt)
fi
${APP_DIR}/venv/bin/pip install --no-cache-dir -r ${APP_DIR}/src/requirements.txt
fi

Wyświetl plik

@ -1 +1 @@
v0.1.1
v0.1.2