From 9e03fc7a4b768c18cb6b9b672f0ab5bc51774fbf Mon Sep 17 00:00:00 2001 From: Tony Tung Date: Wed, 13 Nov 2019 00:49:51 -0600 Subject: [PATCH] Simplify Dockerfile (#1642) It simply overlays a python image 3.6 image with a starfish install. No weird conda bugs. It will be fantastic. Changed the entry point so that it's just a bash shell. Depends on #1641 Test plan: `make docker` --- .dockerignore | 19 ++++++++++++++++++- Makefile | 2 +- docker/Dockerfile | 25 ++++++++++--------------- docker/condarc | 2 -- docker/environment.yml | 13 ------------- docker/pip-config | 2 -- 6 files changed, 29 insertions(+), 34 deletions(-) delete mode 100644 docker/condarc delete mode 100644 docker/environment.yml delete mode 100644 docker/pip-config diff --git a/.dockerignore b/.dockerignore index 6b8710a71..1aaebe24d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,18 @@ -.git +.DS_Store +*.pyc +starfish.egg-info/ +*.ipynb_checkpoints +.coverage +.coverage.* +.mypy_cache/ +.pytest_cache/ +build/ +dist/ +.venv/ +.eggs/ +docs/source/usage/data_formatting_examples/ +docs/source/usage/data_processing_examples/ +docs/source/creating_an_image_processing_pipeline/tutorials/ +.idea/ +.git/ +.hg/ diff --git a/Makefile b/Makefile index 24daca43a..af2013843 100644 --- a/Makefile +++ b/Makefile @@ -121,7 +121,7 @@ slow: fast run-notebooks test-examples docker docker: docker build -f docker/Dockerfile -t $(DOCKER_IMAGE) . - docker run -ti --rm $(DOCKER_IMAGE) --help + docker run -ti --rm $(DOCKER_IMAGE) starfish --help help-integration: diff --git a/docker/Dockerfile b/docker/Dockerfile index a3a02ceb6..2b4e7e4e8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -36,27 +36,22 @@ ## ## $ docker run -e TEST_ISS_KEEP_DATA=true --entrypoint=pytest spacetx/starfish -vsxk TestWithIssData ## -FROM continuumio/miniconda3 +FROM python:3.6-slim-stretch + RUN useradd -m starfish USER starfish +WORKDIR /home/starfish/ -# Set up the initial conda environment -COPY --chown=starfish:starfish docker/environment.yml /src/docker/environment.yml -COPY --chown=starfish:starfish docker/pip-config /src/ -COPY --chown=starfish:starfish docker/condarc /home/starfish/.condarc -COPY --chown=starfish:starfish REQUIREMENTS* /src/ -WORKDIR /src -ENV PIP_CONFIG_FILE=/src/pip-config -RUN conda env create -f docker/environment.yml \ - && conda clean -tipsy +# create a virtual environment +RUN python -m venv .venv +ENV PATH /home/starfish/.venv/bin/:$PATH # Prepare for build -COPY --chown=starfish:starfish . /src -RUN echo "source activate starfish" >> ~/.bashrc -ENV PATH /home/starfish/.conda/envs/starfish/bin:$PATH +COPY --chown=starfish:starfish . /home/starfish/src # Build and configure for running -RUN pip install -e . --ignore-installed --no-cache-dir +RUN pip install -e src --ignore-installed --no-cache-dir env MPLBACKEND Agg -ENTRYPOINT ["starfish"] + +CMD ["bash"] diff --git a/docker/condarc b/docker/condarc deleted file mode 100644 index c862506c9..000000000 --- a/docker/condarc +++ /dev/null @@ -1,2 +0,0 @@ -pkgs_dirs: - - /home/starfish/.conda/pkgs diff --git a/docker/environment.yml b/docker/environment.yml deleted file mode 100644 index 378c92588..000000000 --- a/docker/environment.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: starfish -channels: -- defaults -- bioconda -- conda-forge -dependencies: -- python>=3.6 -- pip -- matplotlib==2.1.2 -- numpy==1.16.1 -- pip: - - -r ../REQUIREMENTS-STRICT.txt - - jsonpath-rw diff --git a/docker/pip-config b/docker/pip-config deleted file mode 100644 index 5ec564090..000000000 --- a/docker/pip-config +++ /dev/null @@ -1,2 +0,0 @@ -[install] -ignore-installed = true