diff --git a/source/user_guide/configure_image.rst b/source/user_guide/configure_image.rst index 6089125c32db207423f0c2bf46988f0230d73d49..e0e71468dfd97a73db57cde8df95695ec728e61a 100644 --- a/source/user_guide/configure_image.rst +++ b/source/user_guide/configure_image.rst @@ -14,16 +14,18 @@ Here, you can see the content of the ``Dockerfile``: # Build image from the base image, previously configured for you - FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.9-slim-bullseye + # Full list of images can be found at + # https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list + FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.9-slim-bullseye--1.5.22.1017 # Add workdir information WORKDIR /srv/shiny-server/ - # install additional dependencies, comment the block if you don't have one - RUN apt-get update \ - && apt-get install -y \ - wget \ - && rm -rf /var/lib/apt/lists/* + # Install additional dependencies, uncomment the block if you have one, and edit/duplicate line 12 + # RUN apt-get update \ + # && apt-get install -y \ + # your-system-dependency \ + # && rm -rf /var/lib/apt/lists/* # Copy your dependencies, destination filename must be "packages_to_install.csv" COPY ./requirements.txt /opt/scripts/requirements.txt @@ -48,16 +50,18 @@ Here, you can see the content of the ``Dockerfile``: # Build image from the base image, previously configured for you - FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.1 + # Full list of images can be found at + # https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list + FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.1--1.5.22.1017 # Add workdir information WORKDIR /srv/shiny-server/ - # install additional dependencies, comment the block if you don't have one - RUN apt-get update \ - && apt-get install -y \ - wget \ - && rm -rf /var/lib/apt/lists/* + # Install additional dependencies, uncomment the block if you have one, and edit/duplicate line 12 + # RUN apt-get update \ + # && apt-get install -y \ + # your-system-dependency \ + # && rm -rf /var/lib/apt/lists/* # Copy your dependencies, destination filename must be "packages_to_install.csv" COPY ./my_packages_to_install.csv /opt/scripts/packages_to_install.csv @@ -88,7 +92,9 @@ Line 1: The base image, with the right version # Build image from the base image, previously configured for you - FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.9-slim-bullseye + # Full list of images can be found at + # https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list + FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/python:3.9-slim-bullseye--1.5.22.1017 .. code-tab:: Dockerfile :caption: R @@ -96,7 +102,9 @@ Line 1: The base image, with the right version # Build image from the base image, previously configured for you - FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.1 + # Full list of images can be found at + # https://hub.pages.pasteur.fr/shiny-k8s/user_guide/configure_image.html#image-list + FROM registry-gitlab.pasteur.fr/hub/shiny-k8s/r:4.3.1--1.5.22.1017 The ``FROM ...`` indicate which base image should be used, the image contains: @@ -129,7 +137,7 @@ Line 5: Working Directory :caption: Python & R :linenos: :selected: - :lineno-start: 4 + :lineno-start: 6 # Add workdir information WORKDIR /srv/shiny-server/ @@ -137,7 +145,7 @@ Line 5: Working Directory We set the **current working directory** to ``/srv/shiny-server/`` . -Lines 8-11: The system dependencies +Lines 10-13: The system dependencies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: @@ -146,26 +154,30 @@ Lines 8-11: The system dependencies :caption: Python & R :linenos: :selected: - :lineno-start: 7 + :lineno-start: 9 - # install additional dependencies, comment the block if you don't have one - RUN apt-get update \ - && apt-get install -y \ - wget \ - && rm -rf /var/lib/apt/lists/* + # Install additional dependencies, uncomment the block if you have one, and edit/duplicate line 12 + # RUN apt-get update \ + # && apt-get install -y \ + # your-system-dependency \ + # && rm -rf /var/lib/apt/lists/* Some of your package dependencies require system dependencies (such as `graphviz-dev <https://packages.ubuntu.com/graphviz-dev>`_ for `pygraphviz <https://pypi.org/project/pygraphviz/>`_). -To add such dependencies, duplicate line 10, and replace **wget** with your -dependencies. +To add such dependencies, +uncomment the bloc 10-13, +adapte/duplicate line 12, +and replace **your-system-dependency** with your actual dependency. +We recommend you to specify one dependency per line, its helps later investigation +when searching for why a dependency have been added. -If you have **no additional system dependencies** you can remove this block. +If you have **no additional system dependencies** you can keep this block commented. -Lines 14-17: The package dependencies +Lines 16-19: The package dependencies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: @@ -173,7 +185,7 @@ Lines 14-17: The package dependencies .. code-tab:: Dockerfile :caption: Python :linenos: - :lineno-start: 13 + :lineno-start: 15 :selected: # Copy your dependencies, destination filename must be "packages_to_install.csv" @@ -186,7 +198,7 @@ Lines 14-17: The package dependencies .. code-tab:: Dockerfile :caption: R :linenos: - :lineno-start: 13 + :lineno-start: 15 # Copy your dependencies, destination filename must be "packages_to_install.csv" COPY ./my_packages_to_install.csv /opt/scripts/packages_to_install.csv @@ -195,8 +207,8 @@ Lines 14-17: The package dependencies RUN Rscript /opt/scripts/install_r_packages.R -The package dependencies are copied into the images line 14, -and installed line 17. The format of the file listing the dependencies depends +The package dependencies are copied into the images line 16, +and installed line 19. The format of the file listing the dependencies depends on the language you use: @@ -243,7 +255,7 @@ If can be from cran, from bioconductor, or even a github package. tidyverse/tibble; github package -Line 20: Grant shiny to create bookmark state +Line 22: Grant shiny to create bookmark state ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: @@ -252,7 +264,7 @@ Line 20: Grant shiny to create bookmark state :caption: Python & R :linenos: :selected: - :lineno-start: 19 + :lineno-start: 21 # grant shiny to created bookmark state directory in this directory RUN chown shiny:shiny /var/lib/shiny-server @@ -260,7 +272,7 @@ Line 20: Grant shiny to create bookmark state In order to run your application, the user ``shiny`` must be allow to write file in ``/var/lib/shiny-server`` directory . -Line 23: Copy your app into the image +Line 25: Copy your app into the image ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: @@ -269,7 +281,7 @@ Line 23: Copy your app into the image :caption: Python & R :linenos: :selected: - :lineno-start: 22 + :lineno-start: 24 # Copy you shiny app COPY ./my_project /srv/shiny-server @@ -279,7 +291,7 @@ Line 23: Copy your app into the image At that moment you copy you app in the image. Keep in mind that this folder name :ref:`can be adapted <Custom source dir name>`. -Line 26: Grant shiny to write output data +Line 28: Grant shiny to write output data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. tabs:: @@ -288,7 +300,7 @@ Line 26: Grant shiny to write output data :caption: Python & R :linenos: :selected: - :lineno-start: 25 + :lineno-start: 27 # grant shiny to use www folder RUN chown shiny:shiny /srv/shiny-server/www