diff options
| author | adamjanovsky | 2022-02-01 17:48:00 +0100 |
|---|---|---|
| committer | GitHub | 2022-02-01 17:48:00 +0100 |
| commit | b1c47f259a2732e02d290e3e564f9de01b857056 (patch) | |
| tree | 96e83cac6518d74561d48a6d6fe9bcd8631b956b /docker/Dockerfile | |
| parent | 9e97f290d3318b35c0932a783d291d5e881ee8fb (diff) | |
| parent | 47a959cae08bb67aab3151d2fdfd85643c7ddaca (diff) | |
| download | sec-certs-0.0.2.tar.gz sec-certs-0.0.2.tar.zst sec-certs-0.0.2.zip | |
Merge pull request #163 from crocs-muni/adamjanovsky/release-managementv0.0.2
Adamjanovsky/release management
Diffstat (limited to 'docker/Dockerfile')
| -rw-r--r-- | docker/Dockerfile | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index df1345ca..a4eff99c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,15 +1,7 @@ FROM ubuntu -ARG NB_USER -ARG NB_UID -ENV USER ${NB_USER} -ENV HOME /home/${NB_USER} - -RUN adduser --disabled-password \ - --gecos "Default user" \ - --uid ${NB_UID} \ - ${NB_USER} -WORKDIR ${HOME} +ENV USER="user" +ENV HOME /home/${USER} #installing dependencies RUN apt-get update @@ -17,31 +9,46 @@ RUN apt-get install python3 -y RUN apt-get install python3-pip -y RUN apt-get install python3-venv -y RUN apt-get install git -y -#------installing the needed thing for PyPDF2 and pdftotext------------------------------------- +RUN apt-get install curl -y +RUN apt-get install python3.8-venv -y + +# Install dependencies fo PyPDF2 and pdftotext RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata RUN apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev poppler-utils -y RUN apt-get install libqpdf-dev -y RUN apt-get install pkg-config -y RUN apt-get install default-jdk -y RUN apt-get install graphviz -y -#----------------------------------------------------------------------------------------------- +RUN adduser --disabled-password \ + --gecos "Default user" \ + ${USER} +USER ${USER} +WORKDIR ${HOME} -RUN git clone https://github.com/crocs-muni/sec-certs.git /opt/sec-certs +# TODO: Change dev to master +# Download only snapshot of repository +RUN \ + curl -L https://api.github.com/repos/crocs-muni/sec-certs/tarball/master > sec-certs.tar.gz && \ + mkdir sec-certs && \ + tar zxf sec-certs.tar.gz --strip-components=1 --directory sec-certs && \ + rm sec-certs.tar.gz -#creating the venv in a way that works, the activation script doesn't work in Docker, we do manualy what it does -ENV VIRTUAL_ENV=/opt/venv -RUN python3 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" +WORKDIR ${HOME}/sec-certs -# Install dependencies: -RUN cp /opt/sec-certs/requirements.txt . -RUN pip install wheel -RUN pip install -r requirements.txt -RUN pip install --no-cache notebook -#just to be sure that pdftotext is in $PATH -ENV PATH /usr/bin/pdftotext:${PATH} +# Create virtual environment +ENV VENV_PATH=${HOME}/venv +RUN python3 -m venv ${VENV_PATH} +ENV PATH="${VENV_PATH}/bin:$PATH" +# Install dependencies, notebook is because of mybinder.org +RUN \ + pip3 install wheel && \ + pip3 install -r requirements.txt && \ + pip3 install --no-cache notebook + +# #just to be sure that pdftotext is in $PATH +ENV PATH /usr/bin/pdftotext:${PATH} -# Run the application: -CMD ["python3", "/opt/sec-certs/cc_cli.py"] +# # Run the application: +# CMD ["python3", "./cc_cli.py"] |
