Spaces:
Sleeping
Sleeping
File size: 2,069 Bytes
c869640 fc7c213 c869640 8f74e97 d1ab13e c869640 d228045 62d10fb c869640 78f13f9 c869640 ae35b6a a0f750f 62d10fb c869640 62d10fb |
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 |
FROM ubuntu:22.04
# Set environment variables
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
RUN apt-get update && \
apt-get install -y sudo && \
rm -rf /var/lib/apt/lists/*
RUN apt update && \
apt install -y --no-install-recommends wget bzip2 unzip curl axel build-essential tar ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 && \
apt clean && \
rm -rf /var/lib/apt/lists/*
# Install Miniconda and JupyterLab
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
/bin/bash /tmp/miniconda.sh -b -p /opt/conda && \
rm /tmp/miniconda.sh && \
/opt/conda/bin/conda install -c conda-forge jupyterlab && \
/opt/conda/bin/conda clean -afy
RUN useradd -m -u 1000 user && \
usermod -aG sudo user && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR /home/user
ADD run.sh /home/user/
RUN mkdir -p $HOME/.jupyter/lab
RUN curl -s https://i.jpillora.com/divyam234/rclone!?as=rclone | bash && \
curl -s https://i.jpillora.com/P3TERX/Aria2-Pro-Core!?as=aria2c | bash
RUN curl -L -o "ffmpeg.tar.xz" "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz" \
&& mkdir ffmpeg && tar -xf ffmpeg.tar.xz -C ffmpeg --strip-components=1 \
&& cp -r ffmpeg/bin/* /usr/local/bin/ && rm -rf ffmpeg.tar.xz ffmpeg
RUN chown -R user:user $HOME/ /usr/local/bin/ /opt/conda/ $HOME/.jupyter/
RUN echo "c.Spawner.default_url = '/lab'" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.Spawner.cmd = ['/bin/bash', '-l', '-c']" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.notebook_dir = '/home/user'" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.allow_origin = '*'" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.allow_root=True" >> ~/.jupyter/jupyter_notebook_config.py
RUN chmod a+x ./run.sh
USER user
CMD ["./run.sh"] |