Skip to content
Snippets Groups Projects
Commit 1860ec90 authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

initial release.

parent 5b02ac68
Branches
No related tags found
No related merge requests found
work
ARG BASE_CONTAINER=brunoe/jupyterutln-default
FROM $BASE_CONTAINER
LABEL maintainer="Emmanuel Bruno <emmanuel.bruno@univ-tln.fr>"
USER root
# Install minimal dependencies
RUN apt-get update && apt-get install -y --no-install-recommends\
coreutils \
dnsutils \
gnupg \
graphviz ttf-bitstream-vera gsfonts \
inkscape \
iputils-ping \
net-tools \
pandoc \
procps \
tree \
zsh \
plantuml && \
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt
# Postgresql python library
RUN conda install --quiet --yes psycopg2 && \
conda install -y -c conda-forge postgresql pgspecial && \
conda clean -tipsy && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
# SQL support for ipython and PlantUML
RUN pip install ipython-sql iplantuml && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
RUN curl https://kumisystems.dl.sourceforge.net/project/plantuml/plantuml.jar -o /usr/local/bin/plantuml.jar
ENV PGDATA=/home/jovyan/work/pgdata
COPY initDB.sh /usr/local/bin/before-notebook.d/
RUN pip install jupyterlab_sql && \
jupyter serverextension enable jupyterlab_sql --py --sys-prefix && \
jupyter lab build && \
fix-permissions "${CONDA_DIR}" && \
fix-permissions "/home/${NB_USER}"
RUN pip install mocodo_magic
RUN jupyter lab --generate-config && \
sed -i -e '/c.InteractiveShellApp.extensions = / s/= [^\]]*/= ["mocodo_magic","sql"]/' -e 's/# \(c.InteractiveShellApp.extensions\)/\1/' ~/.ipython/profile_default/ipython_config.py
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_UID
RUN mkdir -p /home/jovyan/.ssh && ssh-keyscan -t rsa github.com > /home/jovyan/.ssh/known_hosts
WORKDIR /home/jovyan
build.sh 0 → 100755
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. ${DIR}/env.sh
docker build \
--file Dockerfile \
-t ${BASE}:$SHA \
`[[ "$BRANCH" != "master" ]] && echo -t ${BASE}:$BRANCH` \
`[[ "$BRANCH" == "master" ]] && echo -t ${BASE}:latest` \
.
env.sh 0 → 100755
#!/bin/bash
REGISTRY=brunoe
IMAGE_NAME=${PWD##*/}
CURRENT=`pwd`
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
BASE=${REGISTRY}/${IMAGE_NAME}
BRANCH=`git rev-parse --abbrev-ref HEAD|tr '/' '_' `
SHA=`git log -1 --pretty=%h`
cd $CURRENT
DB_NAME=DEMO_DB
rm -rf $PGDATA/$DB_NAME
initdb -D $PGDATA/$DB_NAME
pg_ctl -D $PGDATA/$DB_NAME -l $PGDATA/../$DB_NAME.log start
createdb --owner=jovyan jovyandb
\ No newline at end of file
push.sh 0 → 100755
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo $DIR
. ${DIR}/env.sh
BASE=${REGISTRY}/${IMAGE_NAME}
BRANCH=`git rev-parse --abbrev-ref HEAD`
echo Branche:$BRANCH
docker push ${BASE} --all-tags
run.sh 0 → 100755
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. ${DIR}/env.sh
docker run --rm \
--name ${PWD##*/} \
--volume $PWD/work:/home/jovyan/work \
--publish 8888:8888 \
--env NB_UID=$UID \
--env JUPYTER_ENABLE_LAB=yes \
--env GRANT_SUDO=yes \
--env NB_GID=100 \
${BASE}:$SHA
#--env CHOWN_HOME_OPTS='-R' --env CHOWN_HOME=yes \
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment