From 4e6a3b0b61328f09bb5c75f6aaad3307cb7cf3f6 Mon Sep 17 00:00:00 2001 From: Davide Manna Date: Wed, 9 Jun 2021 17:01:50 +0100 Subject: [PATCH 1/2] Modify Dockerfile.cpu by adding -L option to curl command when retrieving miniconda2; Modify requirements.txt by specifying a non-conflicting version of imageio; Add run_powershell.ps1 script to run on Win10 powershell --- Dockerfile.cpu | 2 +- requirements.txt | 3 ++- run_powershell.ps1 | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 run_powershell.ps1 diff --git a/Dockerfile.cpu b/Dockerfile.cpu index 118909e..4de02e0 100644 --- a/Dockerfile.cpu +++ b/Dockerfile.cpu @@ -7,7 +7,7 @@ ENV OPENCV_VERSION "3.4.8" RUN apt-get update && apt-get install -y curl bzip2 libgl1-mesa-glx -RUN curl https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh > /tmp/conda.sh +RUN curl -L https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh > /tmp/conda.sh RUN bash /tmp/conda.sh -b -p /opt/conda && \ /opt/conda/bin/conda update -n base conda && \ /opt/conda/bin/conda install -y -c pytorch faiss-${FAISS_CPU_OR_GPU}=${FAISS_VERSION} && \ diff --git a/requirements.txt b/requirements.txt index b86bdb3..821b9c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ scikit-image==0.14.0 moviepy==0.2.3.5 tqdm==4.26.0 dlib -imutils \ No newline at end of file +imutils==0.5.3 +imageio<2.7 \ No newline at end of file diff --git a/run_powershell.ps1 b/run_powershell.ps1 new file mode 100644 index 0000000..1742594 --- /dev/null +++ b/run_powershell.ps1 @@ -0,0 +1 @@ +docker run --rm --name Photomosaic --mount type=bind, source="C:\Users\ixb20175\Desktop\Projects\Docker\photomosaic", target="/project" --mount type=bind, source="C:\Users\ixb20175\Pictures", target="/pics" -p "8888:8888/tcp" -e "DISPLAY= \ No newline at end of file From 034424b808dbff43805d7426c3dc2ce5a46a4593 Mon Sep 17 00:00:00 2001 From: Davide Manna Date: Wed, 9 Jun 2021 17:37:49 +0100 Subject: [PATCH 2/2] Modify run_powershell.ps1 by adding parameters --- run_powershell.ps1 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/run_powershell.ps1 b/run_powershell.ps1 index 1742594..0a22f8b 100644 --- a/run_powershell.ps1 +++ b/run_powershell.ps1 @@ -1 +1,21 @@ -docker run --rm --name Photomosaic --mount type=bind, source="C:\Users\ixb20175\Desktop\Projects\Docker\photomosaic", target="/project" --mount type=bind, source="C:\Users\ixb20175\Pictures", target="/pics" -p "8888:8888/tcp" -e "DISPLAY= \ No newline at end of file +param($PicturesDir="c:\Users\$env:UserName\Pictures", $ProjectDir="$pwd", $ContainerName="Photomosaic") + +$env:HostIP = ( + Get-NetIPConfiguration | + Where-Object { + $_.IPv4DefaultGateway -ne $null -and + $_.NetAdapter.Status -ne "Disconnected" + } +).IPv4Address.IPAddress + +docker run --rm --name $ContainerName ` + --mount type=bind,source="$ProjectDir",target="/project" ` + --mount type=bind,source="$PicturesDir",target="/pics" ` + -p "8888:8888/tcp" -e "DISPLAY=$env:HostIP:0" ` + mosaic-conda:latest ` + jupyter notebook ` + --allow-root ` + --ip 0.0.0.0 ` + --no-browser ` + --NotebookApp.token='' ` + --notebook-dir=/project