diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..515b24ada4fc00440dbad4fb62b7e237b7a5f714 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +build.sh diff --git a/Dockerfile b/Dockerfile index 430fe40ed905a5c8e8c1d4e232133789a7de143f..0701571e17608880c81f04ecd2b15609fd9337f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,64 +1,16 @@ FROM nvidia/cuda:11.2.1-cudnn8-runtime-ubuntu20.04 -RUN ln -fs /usr/share/zoneinfo/Europe/Warsaw /etc/localtime -RUN apt-get update && apt-get install -y --no-install-recommends \ - git \ - language-pack-en-base \ - openssh-server \ - openssh-client \ - python3.6 \ - python3-pip \ - python3-setuptools \ - ssh \ - curl \ - sudo \ - vim \ - wget \ - less \ - libglib2.0-0 \ - libsm6 \ - libxext6 \ - libxrender-dev \ - libsndfile1 \ - && rm -rf /var/lib/apt/lists/* \ - && python3 -m pip install --no-cache-dir --upgrade \ - autopep8 \ - doc8 \ - docutils \ - ipython \ - pip \ - pylint \ - pytest \ - rope \ - setuptools \ - wheel \ - torch \ - tqdm \ - pandas - -# Create non-root user -ARG UID=1000 -ARG GID=1000 -ARG USERNAME=nibio -ENV HOME /home/${USERNAME} - -RUN groupadd -g ${GID} ${USERNAME} \ - && useradd -ms /bin/bash -u ${UID} -g ${GID} -G sudo ${USERNAME} \ - && echo "${USERNAME}:${USERNAME}" | chpasswd - -COPY ./check_print.py $HOME - -#USER $USERNAME -WORKDIR $HOME - # install conda ARG UBUNTU_VER=20.04 ARG CONDA_VER=latest ARG OS_TYPE=x86_64 -RUN mkdir conda_installation && cd conda_installation -RUN curl -LO "http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh" -RUN bash Miniconda3-latest-Linux-x86_64.sh -p /miniconda -b +RUN apt-get update && apt-get install -y --no-install-recommends curl + +RUN curl -LO "http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh" && \ + bash Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh -p /miniconda -b && \ + rm Miniconda3-${CONDA_VER}-Linux-${OS_TYPE}.sh + RUN /miniconda/bin/conda update conda RUN /miniconda/bin/conda init bash @@ -70,6 +22,15 @@ RUN echo "conda activate pdal-env" >> ~/.bashrc RUN conda install -c conda-forge pdal python-pdal -#CMD ["echo", "'just test print bash'" ] +COPY requirements.txt /app/requirements.txt +RUN pip install --no-cache -r /app/requirements.txt + +COPY . /app + +ENTRYPOINT ["/miniconda/bin/conda", "run", "-n", "pdal-env", "python", "/app/run.py"] + +WORKDIR /app + +CMD ["--help" ] + -CMD ["python3", "check_print.py" ] diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..0ba2e216fe3e6ccd575c2ed76c12e26a115b1ebc --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#/bin/sh + +docker build -t nibio/cuda-vscode-conda:latest . diff --git a/requirements.txt b/requirements.txt index 5eee61352f1e6c101f7c30e1d72d92191974885f..9e761f979fd0727e61cbb3784f62c165ce705528 100644 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..90fc3c2294a0670e9d86efe69ffde6563021e86a --- /dev/null +++ b/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker run --mount type=bind,src='/home/opc/git_repos/instance_segmentation_classic/config/config.yaml',dst='/app/current_config.yaml' --rm nibio/cuda-vscode-conda:latest --path_to_config_file /app/current_config.yaml