Skip to content

Commit

Permalink
adding docker stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
boecklic committed Jan 30, 2019
1 parent 90bd44c commit c017279
Show file tree
Hide file tree
Showing 6 changed files with 126,157 additions and 1,412 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ FROM python:3.6-stretch
#ENV TINI_VERSION v0.6.0
#ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
#RUN chmod +x /usr/bin/tini

RUN apt-get update && apt-get remove ipython && apt-get install -y \
python3-dev \
ca-certificates \
curl \
gpg \
libgdal-dev
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get update && apt-get remove ipython && apt-get install -y \
python3-dev \
ca-certificates \
curl \
gpg \
libgdal-dev \
nodejs

# The gosu and entrypoint magic is used to create an unprivileged user
# at `docker run`-time with the same uid as the host user. Thus, the mounted
Expand Down Expand Up @@ -46,10 +47,12 @@ RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal"
COPY requirements.txt /tmp/
RUN pip install -r /tmp/requirements.txt && \
pip install --force-reinstall --no-cache-dir jupyter && \
pip freeze
pip freeze && \
jupyter labextension install @jupyterlab/geojson-extension

WORKDIR /home/user

EXPOSE 8888
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0"]
#CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0"]
CMD ["jupyter", "lab", "--port=8888", "--no-browser", "--ip=0.0.0.0"]

11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
DOCKER = docker
DOCKERHUB_USER = boecklic
PWD := $(shell pwd)
LOCAL_UID := $(shell id -u $$USER)
CMD ?=

.PHONY: build
build:
$(DOCKER) build -t jupytest .
$(DOCKER) build -t jupylab .

.PHONY: push
push: build
$(DOCKER) tag jupylab\:latest $(DOCKERHUB_USER)/jupylab\:latest
$(DOCKER) push $(DOCKERHUB_USER)/jupylab\:latest


.PHONY: run
run:
Expand All @@ -18,4 +25,4 @@ run:
# the container
$(DOCKER) run -it --init -p 8888:8888 \
-e LOCAL_UID=$(LOCAL_UID) \
-v $(PWD):/home/user jupytest $(CMD)
-v $(PWD):/home/user boecklic/jupylab\:latest $(CMD)
8 changes: 8 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

## Using the container
```
docker run -it --init -p 8888:8888 \
-e LOCAL_UID=$(id -u $USER) \
-v .:/home/user boecklic/jupylab:latest
```

25 changes: 13 additions & 12 deletions apiexploration.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ipykernel==5.1.0
jupyterlab
# OWSLib requires python-dev
OWSLib==0.17.0
plotly==3.4.2
Expand Down
Loading

0 comments on commit c017279

Please sign in to comment.