Skip to content

Commit

Permalink
Fix docker build (#7761)
Browse files Browse the repository at this point in the history
* Move Dockerfile to the project root

* Add required files to the docker file

* Add the /js/lab directory as a build dep.

* Remove base docker image

* Split install operations in the Dockerfile

* Add only the required files to the docker image

* Remove old Dockerfile

* Update RELEASE.md
  • Loading branch information
JD557 authored and LeeTZ committed Aug 28, 2018
1 parent 99869de commit b4d2c68
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 45 deletions.
1 change: 0 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ Release to Docker Hub
Make sure docker is configured to run with at least 4GB of RAM.

```
docker build -t beakerx-base -f docker/base/Dockerfile .
docker build -t beakerx -f docker/Dockerfile .
docker run -p 8888:8888 beakerx
```
Expand Down
7 changes: 7 additions & 0 deletions beakerx/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@

cmdclass = create_cmdclass(develop_wrappers=[
'js',
'js-lab',
'java',
'javadoc',
], distribute_wrappers=[
'js',
'js-lab',
'java',
'javadoc',
])
Expand All @@ -41,6 +43,11 @@
build_dir=os.path.join(here, '../js/notebook', 'dist'),
source_dir=os.path.join(here, '../js/notebook', 'src')
)
cmdclass['js-lab'] = install_node_modules(
path='../js/lab',
build_dir=os.path.join(here, '../js/lab', 'dist'),
source_dir=os.path.join(here, '../js/lab', 'src')
)
cmdclass['java'] = run_gradle(cmd='build')
cmdclass['javadoc'] = run_gradle(cmd='base:javadoc')

Expand Down
43 changes: 42 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM beakerx-base:latest
FROM ubuntu:16.04

ARG VCS_REF
ARG VERSION
Expand All @@ -28,10 +28,48 @@ LABEL org.label-schema.build-date=$BUILD_DATE \

MAINTAINER BeakerX Feedback <beakerx-feedback@twosigma.com>


###################
# Setup #
###################

RUN useradd beakerx --create-home

ENV CONDA_DIR /opt/conda
ENV PATH /opt/conda/bin:$PATH
ENV NB_USER beakerx
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install -y --no-install-recommends apt-utils sudo curl unzip software-properties-common apt-transport-https git bzip2 wget locales
RUN apt-get dist-upgrade -y
RUN locale-gen en_US.UTF-8

# Install Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install yarn -y

# Install Conda
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh

RUN apt-get clean

RUN conda create -y -n beakerx 'python>=3' nodejs pandas openjdk maven py4j
RUN conda config --env --add pinned_packages 'openjdk >8.0.121'
RUN conda install -y -n beakerx -c conda-forge ipywidgets jupyterhub jupyterlab pyzmq pytest requests

ENV LANG=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV SHELL /bin/bash
ENV NB_UID 1000
ENV HOME /home/$NB_USER

COPY beakerx environment.yml jitpack.yml js kernel test /home/beakerx/
COPY docker/setup.sh / $HOME/
COPY docker/start.sh docker/start-notebook.sh docker/start-singleuser.sh /usr/local/bin/
COPY docker/jupyter_notebook_config.py /etc/jupyter/
Expand All @@ -45,6 +83,9 @@ WORKDIR $HOME
###################
RUN /home/beakerx/setup.sh

# Add documentation
COPY NOTICE README.md StartHere.ipynb doc /home/beakerx/

USER $NB_USER

EXPOSE 8888
Expand Down
43 changes: 0 additions & 43 deletions docker/base/Dockerfile

This file was deleted.

0 comments on commit b4d2c68

Please sign in to comment.