Skip to content

Commit

Permalink
Simplify Dockerfile (#1642)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
Tony Tung authored Nov 13, 2019
1 parent 8d9b2a6 commit 9e03fc7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 34 deletions.
19 changes: 18 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
25 changes: 10 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 0 additions & 2 deletions docker/condarc

This file was deleted.

13 changes: 0 additions & 13 deletions docker/environment.yml

This file was deleted.

2 changes: 0 additions & 2 deletions docker/pip-config

This file was deleted.

0 comments on commit 9e03fc7

Please sign in to comment.