src/Pure/Admin/build_docker.scala
changeset 64895 ad3b66e7a028
parent 64894 6c6bb62702d4
child 64896 6d709a78e269
equal deleted inserted replaced
64894:6c6bb62702d4 64895:ad3b66e7a028
    13 
    13 
    14   private val standard_packages =
    14   private val standard_packages =
    15     List("less", "lib32stdc++6", "libwww-perl", "rlwrap", "unzip")
    15     List("less", "lib32stdc++6", "libwww-perl", "rlwrap", "unzip")
    16 
    16 
    17   private val package_collections =
    17   private val package_collections =
    18     Map("X11" -> List("libx11-6", "libxext6", "libxrender1", "libxtst6", "libxi6"))
    18     Map("X11" -> List("libx11-6", "libxext6", "libxrender1", "libxtst6", "libxi6"),
       
    19       "latex" -> List("texlive-fonts-extra", "texlive-latex-extra", "texlive-math-extra"))
    19 
    20 
    20   def build_docker(progress: Progress,
    21   def build_docker(progress: Progress,
    21     app_archive: Path,
    22     app_archive: Path,
    22     logic: String = default_logic,
    23     logic: String = default_logic,
    23     output: Option[Path] = None,
    24     output: Option[Path] = None,
    92         Getopts("""
    93         Getopts("""
    93 Usage: isabelle build_docker [OPTIONS] APP_ARCHIVE
    94 Usage: isabelle build_docker [OPTIONS] APP_ARCHIVE
    94 
    95 
    95   Options are:
    96   Options are:
    96     -P NAME      additional Ubuntu package collection (""" +
    97     -P NAME      additional Ubuntu package collection (""" +
    97           package_collections.keySet.toList.sorted.mkString(", ") + """)
    98           package_collections.keySet.toList.sorted.map(quote(_)).mkString(", ") + """)
    98     -l NAME      default logic (default ISABELLE_LOGIC=""" + quote(default_logic) + """)
    99     -l NAME      default logic (default ISABELLE_LOGIC=""" + quote(default_logic) + """)
    99     -o FILE      output generated Dockerfile
   100     -o FILE      output generated Dockerfile
   100     -p NAME      additional Ubuntu package
   101     -p NAME      additional Ubuntu package
   101     -t TAG       docker build tag
   102     -t TAG       docker build tag
   102     -v           verbose
   103     -v           verbose
   103 
   104 
   104   Build Isabelle docker image with default logic image, using a standard
   105   Build Isabelle docker image with default logic image, using a standard
   105   Isabelle application archive for Linux.
   106   Isabelle application archive for Linux.
   106 
   107 
   107   The remaining DOCKER_ARGS are passed directly to "docker build".
   108   Example:
       
   109 
       
   110     isabelle build_docker -t isabelle/Isabelle2016-1 Isabelle2016-1_app.tar.gz
   108 """,
   111 """,
   109           "P:" -> (arg =>
   112           "P:" -> (arg =>
   110             package_collections.get(arg) match {
   113             package_collections.get(arg) match {
   111               case Some(ps) => packages :::= ps
   114               case Some(ps) => packages :::= ps
   112               case None => error("Unknown package collection " + quote(arg))
   115               case None => error("Unknown package collection " + quote(arg))