-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_Work_In_Porgress
75 lines (56 loc) · 2.31 KB
/
Dockerfile_Work_In_Porgress
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM debian:bullseye as builder
USER 0
RUN apt update -y
RUN apt upgrade -y
RUN apt install -y wget
### PDI package install
RUN echo "deb [ arch=amd64 ] https://raw.githubusercontent.com/pdidev/repo/debian bullseye main" | tee /etc/apt/sources.list.d/pdi.list > /dev/null
RUN wget -O /etc/apt/trusted.gpg.d/pdidev-archive-keyring.gpg https://raw.githubusercontent.com/pdidev/repo/debian/pdidev-archive-keyring.gpg
RUN chmod a+r /etc/apt/trusted.gpg.d/pdidev-archive-keyring.gpg /etc/apt/sources.list.d/pdi.list
# Temporary workaround to guarantee the updated tarball is downloaded
# and we are using up-to-date debian packages
#
# Calls for a random number to break the cahing of the following wget
# (https://stackoverflow.com/questions/35134713/disable-cache-for-specific-run-commands/58801213#58801213)
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
RUN apt update -y
RUN apt install -y pdidev-archive-keyring
### Custom packages
RUN wget https://gac.udc.es/~emilioj/bullseye.tgz
RUN tar -xf bullseye.tgz
WORKDIR /bullseye
RUN apt install -y `find . -name "*.deb"`
# install the notebook package
RUN apt install python3-pip -y
RUN python3 -m pip install --no-cache-dir notebook jupyterlab jupyterhub
#RUN python3 -m pip install --no-cache-dir stable-baselines3==1.4.0
#RUN python3 -m pip install d3rlpy
#RUN pip install --no-cache --upgrade pip && pip install --no-cache notebook jupyterlab
### Image config
ENV VIRTUAL_ENV /opt/gym_dssat_pdi
ENV PATH "${VIRTUAL_ENV}/bin:${PATH}"
RUN echo "export PATH=${PATH}" >> /etc/profile
RUN bash -l -c 'echo export GYM_DSSAT_PDI_PATH="/opt/gym_dssat_pdi/lib/$(python3 -V | tr -d '[:blank:]' | tr '[:upper:]' '[:lower:]' | sed 's/\.[^.]*$//')/site-packages/gym_dssat_pdi" >> /etc/bash.bashrc'
### create user with a home directory
ARG NB_USER=test
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
WORKDIR ${HOME}
#RUN useradd -ms /bin/bash gymusr
#USER gymusr
#WORKDIR /home/gymusr
ENV BASH_ENV=/etc/profile
SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["/bin/bash", "-c"]
# Make sure the contents of our repo are in ${HOME}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}
#CMD ["python /opt/gym_dssat_pdi/samples/run_env.py"]