Skip to content

Commit

Permalink
Improve docker caching in Dockerfile-ModelServer
Browse files Browse the repository at this point in the history
Moved the adding of build.sh to the end, so the ModelServer dockerfile
shares as many lines as possible with ModelBuilder, so their
docker layers will be shared.
  • Loading branch information
Erik Parmann authored and epa095 committed Jan 7, 2019
1 parent 83f1bcd commit 1fae3ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile-ModelBuilder
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ FROM python:3.6.8-slim-stretch
COPY requirements.txt /code/
RUN pip install -r /code/requirements.txt

# Install gordo-components, packaged from earlier 'python setup.py sdist'
COPY --from=builder /code/dist/gordo-components-packed.tar.gz .

# Install gordo-components, packaged from earlier 'python setup.py sdist'
RUN pip install ./gordo-components-packed.tar.gz

ADD build.sh /code/build.sh

# build.sh (build the model) as executable default command
RUN cp /code/build.sh /usr/bin/build \
&& chmod +x /usr/bin/build

# Install gordo-components, packaged from earlier 'python setup.py sdist'
COPY --from=builder /code/dist/gordo-components-packed.tar.gz .

RUN pip install ./gordo-components-packed.tar.gz

CMD ["build"]
1 change: 1 addition & 0 deletions Dockerfile-ModelServer
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ FROM python:3.6.8-slim-stretch
COPY requirements.txt /code/
RUN pip install -r /code/requirements.txt

# Install gordo-components, packaged from earlier 'python setup.py sdist'
COPY --from=builder /code/dist/gordo-components-packed.tar.gz .

# Install gordo-components, packaged from earlier 'python setup.py sdist'
Expand Down

0 comments on commit 1fae3ad

Please sign in to comment.