Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
shiny-k8s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hub
shiny-k8s
Commits
6f563761
Commit
6f563761
authored
1 year ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
update dockerfile doc to follow the examples
parent
a1676194
No related branches found
Branches containing commit
No related tags found
1 merge request
!31
update dockerfile doc to follow the examples
Pipeline
#133790
passed
1 year ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/user_guide/configure_image.rst
+48
-36
48 additions, 36 deletions
source/user_guide/configure_image.rst
with
48 additions
and
36 deletions
source/user_guide/configure_image.rst
+
48
−
36
View file @
6f563761
...
...
@@ -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/
#
i
nstall 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/*
#
I
nstall additional dependencies,
un
comment 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/
#
i
nstall 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/*
#
I
nstall additional dependencies,
un
comment 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
-1
1
: The system dependencies
Lines
10
-1
3
: 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
#
i
nstall 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/*
#
I
nstall additional dependencies,
un
comment 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 1
4
-1
7
: The package dependencies
Lines 1
6
-1
9
: The package dependencies
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. tabs::
...
...
@@ -173,7 +185,7 @@ Lines 14-17: The package dependencies
.. code-tab:: Dockerfile
:caption: Python
:linenos:
:lineno-start: 1
3
:lineno-start: 1
5
: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: 1
3
:lineno-start: 1
5
# 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 1
4
,
and installed line 1
7
. The format of the file listing the dependencies depends
The package dependencies are copied into the images line 1
6
,
and installed line 1
9
. 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 2
0
: Grant shiny to create bookmark state
Line 2
2
: 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: 1
9
:lineno-start:
2
1
# 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 2
3
: Copy your app into the image
Line 2
5
: 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: 2
2
:lineno-start: 2
4
# 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 2
6
: Grant shiny to write output data
Line 2
8
: 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: 2
5
:lineno-start: 2
7
# grant shiny to use www folder
RUN chown shiny:shiny /srv/shiny-server/www
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment