Optimize Dockerfile
Currently, changes to nearly any file in the repository will cause `docker build` to have to reinitialize the python environment and the Java environment. This change reorders some of the commands and copies in dependent files incrementally in order to maximize caching and make repeated test runs move faster.
This commit is contained in:
Родитель
22ce6d8ada
Коммит
11d3fa2ca8
15
Dockerfile
15
Dockerfile
|
@ -19,22 +19,29 @@ RUN dnf -y update && \
|
|||
cargo \
|
||||
&& dnf clean all
|
||||
|
||||
# Install jsonschema-transpiler
|
||||
ENV PATH=$PATH:/root/.cargo/bin
|
||||
RUN cargo install jsonschema-transpiler --version 1.8.0
|
||||
|
||||
# Configure git for testing
|
||||
RUN git config --global user.email "mozilla-pipeline-schemas@mozilla.com"
|
||||
RUN git config --global user.name "Mozilla Pipeline Schemas"
|
||||
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
# Install python dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip3 install -r requirements.txt
|
||||
|
||||
# Install Java dependencies
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:copy-dependencies
|
||||
|
||||
RUN rm -rf /app/release && \
|
||||
mkdir /app/release && \
|
||||
COPY . /app
|
||||
|
||||
RUN mkdir release && \
|
||||
cd release && \
|
||||
cmake .. && \
|
||||
make
|
||||
|
||||
WORKDIR /app
|
||||
CMD pytest -v
|
||||
|
|
Загрузка…
Ссылка в новой задаче