Skip to content

Commit

Permalink
Reorganize Dockerfile to leverage build cache
Browse files Browse the repository at this point in the history
Add an explicit copy of the requirements file and call the pip install on it
earlier so that on modification of the ocs package we don't have to download
all dependencies again. This'll improve turn around time when iterating on
building OCS Docker images locally for testing during development.
  • Loading branch information
BrianJKoopman committed Aug 2, 2021
1 parent 57638df commit 1020d4a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ RUN apt-get update && apt-get install -y python3 \
# Install init system
RUN pip3 install dumb-init

# Copy in and install requirements
# This will leverage the cache for rebuilds when modifying OCS, avoiding
# downloading all the requirements again
COPY requirements.txt /app/ocs/requirements.txt
WORKDIR /app/ocs/
RUN pip3 install -r requirements.txt

# Copy the current directory contents into the container at /app
COPY . /app/ocs/

WORKDIR /app/ocs/

# Install ocs
RUN pip3 install -r requirements.txt && \
pip3 install -e .
RUN pip3 install -e .

0 comments on commit 1020d4a

Please sign in to comment.