Use customized image or Docker file

Hi all, Is that possible to use ubuntu 20.04 as the base image? I did somethig like this but failed. Thanks.

########################################################
#        Renku install section - do not edit           #

FROM renku/renkulab-py:3.10-0.22.0 as builder

# RENKU_VERSION determines the version of the renku CLI
# that will be used in this image. To find the latest version,
# visit https://pypi.org/project/renku/#history.
ARG RENKU_VERSION=2.9.2

# Install renku from pypi or from github if a dev version
RUN if [ -n "$RENKU_VERSION" ] ; then \
        source .renku/venv/bin/activate ; \
        currentversion=$(renku --version) ; \
        if [ "$RENKU_VERSION" != "$currentversion" ] ; then \
            pip uninstall renku -y ; \
            gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \
            if [ -n "$gitversion" ] ; then \
                pip install --no-cache-dir --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\
            else \
                pip install --no-cache-dir --force renku==${RENKU_VERSION} ;\
            fi \
        fi \
    fi
#             End Renku install section                #
########################################################

# Use Ubuntu as the base image
FROM ubuntu:20.04

# Set the working directory
WORKDIR /app

# Copy the list of installed packages to the working directory
COPY packages.list .

# Update package list and install necessary tools
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        dirmngr \
        gnupg \
        apt-transport-https \
        ca-certificates \
        software-properties-common \
        wget \
        && rm -rf /var/lib/apt/lists/*

Hi @jingheng this is currently technically possible. But to make the image work with Renku you have to have jupyter in it and you have to run jupyter server in a specific way and on a specific port, etc. So if you add this to an image like ubuntu or debian you will end up with pretty much the same thing as the renku base image. So I would reccomend that if you can you should use the official renku base image.

We are currently working on a new version of Renku that would remove a lot of these restrictions on the image that users are allowed to use in Renku. But for now using the official base images is the easiest way.

May I ask why you need to use a different base image?

Hi Tolevski, Thanks for the reply. I’m working with python 3.6. I found it’s difficult to set up the conda enviroment on the Renkulad, so I guess it’s easier to use my own image directly. Looking forward to the new version. It would be nice if the user can choosed thier own image from the docker hub.

Hi @jingheng , You can easily work with conda as documented here.

Hi, I tried to create or update a conda enviroment. But is has been killed. "Collecting package metadata (repodata.json): - Killed: `name: “pcraster”. Below is my yml file. Is this because that I want to use python 3.6 ? Thanks in advance for the help.

# WARNING : As Renku makes use of mamba for more efficient package builds, please use the popular "conda-forge" channel
# For more details : https://mamba.readthedocs.io/en/latest/user_guide/troubleshooting.html#mixing-the-defaults-and-conda-forge-channels
# Using the defaults channel from Anaconda can easily result in getting your
# laptop, CI pipeline, etc. blacklisted by Anaconda which makes building packages
# impossible. To get permission to use Anaconda again you need to either pay or prove that
# you meet the requirements for a free license. Using the conda-forge channel avoids 
# these restrictions completely.
channels:
  - conda-forge
# dependencies:
# - add packages here
# - one per line
prefix: "/opt/conda"

dependencies:
  - python=3.6.15=hb7a2778_0_cpython
  - python-dateutil=2.8.2=pyhd8ed1ab_0
  - python_abi=3.6=2_cp36m
  - _libgcc_mutex=0.1=conda_forge
  - _openmp_mutex=4.5=2_gnu
  - affine=2.3.1=pyhd8ed1ab_0
  - alsa-lib=1.2.3=h516909a_0
  - attrs=21.4.0=pyhd8ed1ab_0
  - backports=1.0=py_2
  - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
  - boost-cpp=1.74.0=hc6e9bd1_3
  - bzip2=1.0.8=h7f98852_4
  - c-ares=1.18.1=h7f98852_0
  - ca-certificates=2023.01.10=h06a4308_0
  - cairo=1.16.0=h6cf1ce9_1008
  - campo=0.3.1=pyhd8ed1ab_1
  - cdo=1.9.9=had776b3_14
  - certifi=2021.5.30=py36h06a4308_0
  - cfitsio=3.470=hb418390_7
  - cftime=1.5.1=py36he33b4a0_0
  - click=7.1.2=pyh9f0ad1d_0
  - click-plugins=1.1.1=py_0
  - cligj=0.7.2=pyhd8ed1ab_1
  - curl=7.82.0=h7bff187_0
  - cycler=0.11.0=pyhd8ed1ab_0
  - dbus=1.13.6=h5008d03_3
  - decorator=5.1.1=pyhd8ed1ab_0
  - eccodes=2.21.0=ha0e6eb6_0
  - et_xmlfile=1.1.0=py36h06a4308_0
  - expat=2.4.8=h27087fc_0
  - fftw=3.3.10=nompi_h77c792f_102
  - fiona=1.8.18=py36hd875ef1_0
  - font-ttf-dejavu-sans-mono=2.37=hab24e00_0
  - font-ttf-inconsolata=3.000=h77eed37_0
  - font-ttf-source-code-pro=2.038=h77eed37_0
  - font-ttf-ubuntu=0.83=hab24e00_0
  - fontconfig=2.14.0=h8e229c2_0
  - fonts-conda-ecosystem=1=0
  - fonts-conda-forge=1=0
  - freetype=2.10.4=h0708190_1
  - freexl=1.0.6=h7f98852_0
  - gdal=3.1.4=py36h36826cb_8
  - geopandas=0.9.0=py_1
  - geopandas-base=0.9.0=py_1
  - geos=3.9.1=h9c3ff4c_2
  - geotiff=1.6.0=h2b14fbe_4
  - gettext=0.19.8.1=h73d1719_1008
  - giflib=5.2.1=h36c2ea0_2
  - glew=2.1.0=h9c3ff4c_2
  - gst-plugins-base=1.18.5=hf529b03_3
  - gstreamer=1.18.5=h9f60fe5_3
  - hdf4=4.2.15=h10796ff_3
  - hdf5=1.10.6=nompi_h6a2412b_1114
  - icu=68.2=h9c3ff4c_0
  - ipython=5.8.0=py36_1
  - ipython_genutils=0.2.0=py_1
  - jasper=1.900.1=h07fcdf6_1006
  - jbig=2.1=h7f98852_2003
  - joblib=1.0.1=pyhd3eb1b0_0
  - jpeg=9e=h166bdaf_1
  - json-c=0.15=h98cffda_0
  - kealib=1.4.14=hcc255d8_2
  - keyutils=1.6.1=h166bdaf_0
  - kiwisolver=1.3.1=py36h605e78d_1
  - krb5=1.19.3=h3790be6_0
  - lcms2=2.12=hddcbb42_0
  - ld_impl_linux-64=2.36.1=hea4e1c9_2
  - lerc=3.0=h9c3ff4c_0
  - libaec=1.0.6=h9c3ff4c_0
  - libblas=3.9.0=14_linux64_openblas
  - libcblas=3.9.0=14_linux64_openblas
  - libclang=11.1.0=default_ha53f305_1
  - libcurl=7.82.0=h7bff187_0
  - libdap4=3.20.6=hd7c4107_2
  - libdeflate=1.10=h7f98852_0
  - libedit=3.1.20191231=he28a2e2_2
  - libev=4.33=h516909a_1
  - libevent=2.1.10=h9b69904_4
  - libffi=3.4.2=h7f98852_5
  - libgcc-ng=11.2.0=h1d223b6_16
  - libgdal=3.1.4=h38ff51b_8
  - libgfortran-ng=11.2.0=h69a702a_16
  - libgfortran5=11.2.0=h5c6108e_16
  - libglib=2.70.2=h174f98d_4
  - libglu=9.0.0=he1b5a44_1001
  - libgomp=11.2.0=h1d223b6_16
  - libiconv=1.16=h516909a_0
  - libkml=1.3.0=h238a007_1014
  - liblapack=3.9.0=14_linux64_openblas
  - libllvm11=11.1.0=hf817b99_3
  - libnetcdf=4.7.4=nompi_h56d31a8_107
  - libnghttp2=1.47.0=h727a467_0
  - libnsl=2.0.0=h7f98852_0
  - libogg=1.3.4=h7f98852_1
  - libopenblas=0.3.20=pthreads_h78a6416_0
  - libopus=1.3.1=h7f98852_1
  - libpng=1.6.37=h21135ba_2
  - libpq=13.5=hd57d9b9_1
  - librttopo=1.1.0=h1185371_6
  - libspatialindex=1.9.3=h9c3ff4c_4
  - libspatialite=5.0.1=he52d314_3
  - libssh2=1.10.0=ha56f1ee_2
  - libstdcxx-ng=11.2.0=he4da1e4_16
  - libtiff=4.2.0=hbd63e13_2
  - libuuid=2.32.1=h7f98852_1000
  - libvorbis=1.3.7=h9c3ff4c_0
  - libwebp-base=1.2.2=h7f98852_1
  - libxcb=1.13=h7f98852_1004
  - libxkbcommon=1.0.3=he3ba5ed_0
  - libxml2=2.9.12=h72842e0_0
  - libzip=1.8.0=h4de3113_1
  - libzlib=1.2.11=h166bdaf_1014
  - lue=0.2.0=py36h5a2f2ec_4
  - lz4-c=1.9.3=h9c3ff4c_1
  - mapclassify=2.4.3=pyhd3eb1b0_0
  - matplotlib=3.3.4=py36h5fab9bb_0
  - matplotlib-base=3.3.4=py36hd391965_0
  - munch=2.5.0=py_0
  - mysql-common=8.0.25=ha770c72_0
  - mysql-libs=8.0.25=h935591d_0
  - ncurses=6.3=h27087fc_1
  - netcdf4=1.5.6=nompi_py36hb848c25_102
  - networkx=2.2=py36_1
  - nspr=4.32=h9c3ff4c_1
  - nss=3.77=h2350873_0
  - numpy=1.19.5=py36hfc0c790_2
  - olefile=0.46=pyh9f0ad1d_1
  - openjpeg=2.4.0=hb52868f_1
  - openpyxl=3.0.9=pyhd3eb1b0_0
  - openssl=1.1.1s=h7f8727e_0
  - ossuuid=1.6.2=hf484d3e_1000
  - pandas=1.1.5=py36h284efc9_0
  - pcraster=4.3.0=py36hbfe1973_6
  - pcre=8.45=h9c3ff4c_0
  - pexpect=4.8.0=pyh9f0ad1d_2
  - pickleshare=0.7.5=py_1003
  - pillow=8.2.0=py36ha6010c0_1
  - pip=21.3.1=pyhd8ed1ab_0
  - pixman=0.40.0=h36c2ea0_0
  - poppler=0.89.0=h2de54a5_5
  - poppler-data=0.4.11=hd8ed1ab_0
  - postgresql=13.5=h2510834_1
  - proj=7.2.0=h277dcde_2
  - prompt_toolkit=1.0.15=py_1
  - pthread-stubs=0.4=h36c2ea0_1001
  - ptyprocess=0.7.0=pyhd3deb0d_0
  - pygments=2.12.0=pyhd8ed1ab_0
  - pyparsing=3.0.8=pyhd8ed1ab_0
  - pyproj=3.0.1=py36h13f0598_0
  - pyqt=5.12.3=py36h5fab9bb_7
  - pyqt-impl=5.12.3=py36h7ec31b9_7
  - pyqt5-sip=4.19.18=py36hc4f0c31_7
  - pyqtchart=5.12=py36h7ec31b9_7
  - pyqtwebengine=5.12.1=py36h7ec31b9_7
  - pytz=2022.1=pyhd8ed1ab_0
  - qt=5.12.9=hda022c4_4
  - rasterio=1.2.1=py36h235859b_0
  - readline=8.1=h46c0cb4_0
  - rtree=0.9.7=py36hb415506_1
  - scikit-learn=0.24.2=py36ha9443f7_0
  - scipy=1.5.3=py36h81d768a_1
  - sdl2=2.0.18=h27087fc_0
  - setuptools=58.0.4=py36h5fab9bb_2
  - shapely=1.7.1=py36hff28ebb_5
  - simplegeneric=0.8.1=py_1
  - six=1.16.0=pyh6c4a22f_0
  - snuggs=1.4.7=py_0
  - sqlite=3.38.2=h4ff8645_0
  - threadpoolctl=2.2.0=pyh0d69192_0
  - tiledb=2.2.9=h91fcb0e_0
  - tk=8.6.12=h27826a3_0
  - tornado=6.1=py36h8f6f2f9_1
  - traitlets=4.3.3=pyhd8ed1ab_2
  - tzcode=2022a=h166bdaf_0
  - tzdata=2022a=h191b570_0
  - udunits2=2.2.28=hc3e0081_0
  - wcwidth=0.2.5=pyh9f0ad1d_2
  - wheel=0.37.1=pyhd8ed1ab_0
  - xarray=0.18.2=pyhd8ed1ab_0
  - xerces-c=3.2.3=h9d8b166_3
  - xlrd=2.0.1=pyhd8ed1ab_3
  - xorg-kbproto=1.0.7=h7f98852_1002
  - xorg-libice=1.0.10=h7f98852_0
  - xorg-libsm=1.2.3=hd9c2040_1000
  - xorg-libx11=1.7.2=h7f98852_0
  - xorg-libxau=1.0.9=h7f98852_0
  - xorg-libxdmcp=1.1.3=h7f98852_0
  - xorg-libxext=1.3.4=h7f98852_1
  - xorg-libxrender=0.9.10=h7f98852_1003
  - xorg-renderproto=0.11.1=h7f98852_1002
  - xorg-xextproto=7.3.0=h7f98852_1002
  - xorg-xproto=7.0.31=h7f98852_1007
  - xz=5.2.5=h516909a_1
  - zlib=1.2.11=h166bdaf_1014
  - zstd=1.4.9=ha95c52a_0

Never mind, I restart it, then it works. I have a conda environment. However, when I start a notbook, the enviroment is still the base.Is there a way to use my conda enviroment to lauch the notebook? thanks.