Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
Matt Fisher ef10fe4ae3
Merge e4c2b41097 into a20dd1cf97 2024-02-16 15:45:58 +08:00
Matt Fisher e4c2b41097
Correct my misunderstanding and add documentation that would have helped past me
I did not see the "Can I use repo2docker to bootstrap my own
Dockerfile?" FAQ the first time through. I've linked it from the part
that I _did_ see so hopefully the next person through (maybe me in 6
months) won't have the same misunderstanding!
2023-05-18 20:13:10 -06:00
Matt Fisher e1ce6f55b6
Warn of unexpected behavior when creating a Dockerfile from debug output
When creating a Dockerfile from redirecting debug output, `repo2docker`
sees the initially-empty `Dockerfile` and that influences its output
(since `Dockerfile` is empty, `repo2docker` outputs nothing).
2023-05-18 12:01:35 -06:00
Matt Fisher f610e1bbb5
Add link from Dockerfile config file to debug usage 2023-05-18 11:41:45 -06:00
Matt Fisher c2a3750556
Support Sphinx >=6.x
https://github.com/sphinx-doc/sphinx/issues/11094

`extlinks` config expects a formatting slug in the caption portion of
its config. Without it, Sphinx 6.x throws:

    Exception occurred:
      File "/path/to/site-packages/sphinx/ext/extlinks.py", line 103, in role
        title = caption % part
    TypeError: not all arguments converted during string formatting
2023-05-18 11:31:41 -06:00
3 zmienionych plików z 51 dodań i 6 usunięć

Wyświetl plik

@ -242,10 +242,13 @@ In the majority of cases, providing your own Dockerfile is not necessary as the
images provide core functionality, compact image sizes, and efficient builds. We recommend
trying the other configuration files before deciding to use your own Dockerfile.
With Dockerfiles, a regular Docker build will be performed.
Try the ``--appendix`` :ref:`CLI flag <usage-cli>` as a last resort. If you
still can't achieve your goals, you should create a Dockerfile from scratch to
define your image.
.. note::
If a Dockerfile is present, all other configuration files will be ignored.
With Dockerfiles, a regular Docker build will be performed. All other
configuration files will be ignored.
See the `Advanced Binder Documentation <https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html>`_ for
best-practices with Dockerfiles.

Wyświetl plik

@ -115,6 +115,9 @@ flag for each variable that you want to define.
For example ``jupyter-repo2docker -e VAR1=val1 -e VAR2=val2 ...``
.. _faq-dockerfile-bootstrap:
Can I use repo2docker to bootstrap my own Dockerfile?
-----------------------------------------------------
@ -189,3 +192,33 @@ tool called `source2image <https://github.com/openshift/source-to-image/>`_.
This is an excellent open tool for containerization, but we
ultimately decided that it did not fit the use-case we wanted to address. For more information,
`here <https://github.com/yuvipanda/words/blob/fd096dd49d87e624acd8bdf6d13c0cecb930bb3f/content/post/why-not-s2i.md>`_ is a short blog post about the decision and the reasoning behind it.
Where are my ``man`` pages?
---------------------------
The base image used by ``repo2docker`` is `Minimal Ubuntu
<https://wiki.ubuntu.com/Minimal>`_ version 18. In Minimal Ubuntu, ``man``
pages are disabled to reduce image size. If your use case is interactive
computing or education, you may want to re-enable ``man`` pages. To do this,
use the ``--appendix`` :ref:`CLI flag <usage-cli>` to pass in additional
``Dockerfile`` instructions, for example:
.. code-block:: dockerfile
# Re-enable man pages disabled in Ubuntu 18 minimal image
# https://wiki.ubuntu.com/Minimal
USER root
RUN yes | unminimize
# NOTE: $NB_PYTHON_PREFIX is the same as $CONDA_PREFIX at run-time.
# $CONDA_PREFIX isn't available in this context.
# NOTE: Prepending ensures a working path; if $MANPATH was previously empty,
# the trailing colon ensures that system paths are searched.
ENV MANPATH="${NB_PYTHON_PREFIX}/share/man:${MANPATH}"
RUN mandb
# Revert to default user
USER ${NB_USER}
This appendix can be used by, for example, writing it to a file named
``appendix`` and executing ``repo2docker --appendix "$(cat appendix)" .``.

Wyświetl plik

@ -106,14 +106,21 @@ by ``repo2docker`` to see how to configure the build process.
:ref:`configuration files <config-files>`.
.. _usage-debugging-with-debug-and-no-build:
Debugging repo2docker with ``--debug`` and ``--no-build``
=========================================================
.. warning::
This feature is *not* for bootstrapping a custom Dockerfile. Please see the
:ref:`relevant FAQ entry <faq-dockerfile-bootstrap>`.
To debug the docker image being built, pass the ``--debug`` parameter:
.. code-block:: bash
.. code-block:: bash
jupyter-repo2docker --debug https://github.com/norvig/pytudes
jupyter-repo2docker --debug https://github.com/norvig/pytudes
This will print the generated ``Dockerfile``, build it, and run it.
@ -122,11 +129,13 @@ pass ``--no-build`` to the commandline. This ``Dockerfile`` output
is for **debugging purposes** of ``repo2docker`` only - it can not
be used by docker directly.
.. code-block:: bash
.. code-block:: bash
jupyter-repo2docker --no-build --debug https://github.com/norvig/pytudes
jupyter-repo2docker --no-build --debug https://github.com/norvig/pytudes
.. _usage-cli:
Command line API
================