ethereum / beacon_chain

MIT License
209 stars 65 forks source link

fix(docker): copy files before pip install #101

Closed johnsBeharry closed 5 years ago

johnsBeharry commented 5 years ago

PROBLEM

Scenario: Docker build fails
Given I have just cloned the repo
When I run "make build"
Then I receive the error "Directory '.' is not installable. File 'setup.py' not found."
And the docker image does not build

SOLUTION

Scenario: Add source files into the build image earlier
Given the problematic "Dockerfile" is
"""
FROM python:3.6-stretch

WORKDIR /usr/src/app

RUN pip install --upgrade setuptools
RUN pip install -e .[dev] --no-cache-dir

COPY . .

CMD [ "tail", "-f" "/dev/null" ]
"""
When I  move "COPY . ." before "pip install -e .[dev] --no-cache-dir"
Then pip can properly resolve "beacon_chain" and "ssz"
And "make build" runs successfully

CUTE ANIMAL PICTURE? 😅

tumblr_nhl0bb7kjx1qi4ucgo1_500

hwwhww commented 5 years ago

Thank you @johnsBeharry! And I like your the cute animal picture!