Skip to content

Commit

Permalink
🛠 Fix Dockerfile (#478)
Browse files Browse the repository at this point in the history
* Fix Dockerfile

1. Install `nodejs npm ruby` (first two required by prettier hook,
last one required by markdownlint)
2. Readd `./requirements/dev.txt` with appropriate packages needed for
development

* Address codacy complaints

* Disable pip cache in Dockerfile for smaller Images

* Pin versions to the ones used by pre-commit
  • Loading branch information
ORippler committed Aug 3, 2022
1 parent 145aeec commit 6dfb283
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
28 changes: 22 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,20 @@ FROM nvidia/cuda:11.4.0-devel-ubuntu20.04 AS python_base_cuda
LABEL MAINTAINER="Anomalib Development Team"

# Update system and install wget
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y wget ffmpeg libpython3.8 git sudo
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
wget=1.20.3-1ubuntu2 \
ffmpeg=7:4.2.7-0ubuntu0.1 \
libpython3.8=3.8.10-0ubuntu1~20.04.5 \
git=1:2.25.1-1ubuntu3.5 \
sudo=1.8.31-1ubuntu1.2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Conda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh --quiet && \
bash ~/miniconda.sh -b -p /opt/conda
bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh
ENV PATH "/opt/conda/bin:${PATH}"
RUN conda install python=3.8

Expand All @@ -23,16 +32,23 @@ FROM python_base_cuda as anomalib_development_env

# Install all anomalib requirements
COPY ./requirements/base.txt /tmp/anomalib/requirements/base.txt
RUN pip install -r /tmp/anomalib/requirements/base.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/base.txt

COPY ./requirements/openvino.txt /tmp/anomalib/requirements/openvino.txt
RUN pip install -r /tmp/anomalib/requirements/openvino.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/openvino.txt

# Install other requirements related to development
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \
nodejs=10.19.0~dfsg-3ubuntu1 \
npm=6.14.4+ds-1ubuntu2 \
ruby=1:2.7+1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY ./requirements/dev.txt /tmp/anomalib/requirements/dev.txt
RUN pip install -r /tmp/anomalib/requirements/dev.txt
RUN pip install --no-cache-dir -r /tmp/anomalib/requirements/dev.txt

# Install anomalib
COPY . /anomalib
WORKDIR /anomalib
RUN pip install -e .
RUN pip install --no-cache-dir -e .
7 changes: 7 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
black==22.6.0
isort==5.10.1
pylint==2.14.5
flake8==4.0.1
pytest
pre-commit>=2.15.0
tox>=3.24.3

0 comments on commit 6dfb283

Please sign in to comment.