diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..cc8a02a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:latest AS prebuild +ARG repository_url=https://github.com/Panchos39/Machine-Learning-Introduction.git +RUN apt-get update > /dev/null \ + && apt-get install -y curl unrar git +WORKDIR /downloads +COPY download_data.sh . +RUN ./download_data.sh +RUN git clone $repository_url ML/ \ + && unrar e data.rar ML/data/ + +FROM jupyter/minimal-notebook:latest +USER $NB_UID +RUN conda install --quiet --yes numpy pandas +WORKDIR /home/$NB_USER +COPY --from=prebuild /downloads/ML ./ML diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..aa56899 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,17 @@ +## Minimal Docker configuration + +Prebuild: + +Install Docker (Docker Desktop) + +Build: + +```console + ./build.sh +``` + +Run: + +```console + ./run.sh +``` diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 0000000..8e10b8a --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker build -t jupyter-notebook:1.0 . diff --git a/docker/download_data.sh b/docker/download_data.sh new file mode 100755 index 0000000..f19a2d7 --- /dev/null +++ b/docker/download_data.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +file_id="1Wkxfuw2zIfa4yPgVXXtrq4TCURBRu3yG" +filename="data.rar" +curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${file_id}" > /dev/null +curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${file_id}" -o ${filename} \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 0000000..4bbaf4b --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker run -p 8888:8888 jupyter-notebook:1.0 \ No newline at end of file