src/Pure/Tools/build_docker.scala
author wenzelm
Sat, 23 Mar 2019 17:10:53 +0100
changeset 69957 e3217c6d6467
parent 69873 6ebe97815275
child 69958 70dc3c4e9469
permissions -rw-r--r--
updated docker setup: lib32stdc++6 is no longer required for polyml-5.8, libfontconfig1 is required for headless jdk-11;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66790
c0e68e6a1beb build_docker is regular tool (non-admin);
wenzelm
parents: 66785
diff changeset
     1
/*  Title:      Pure/Tools/build_docker.scala
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     3
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     4
Build docker image from Isabelle application bundle for Linux.
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     5
*/
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     6
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     7
package isabelle
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     8
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
     9
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    10
object Build_Docker
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    11
{
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    12
  private val default_base = "ubuntu"
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    13
  private lazy val default_logic = Isabelle_System.getenv("ISABELLE_LOGIC")
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    14
69957
e3217c6d6467 updated docker setup: lib32stdc++6 is no longer required for polyml-5.8, libfontconfig1 is required for headless jdk-11;
wenzelm
parents: 69873
diff changeset
    15
  private val Isabelle_Name = """^.*?(Isabelle[^/\\:]+)_linux\.tar\.gz$""".r
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    16
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
    17
  val packages: List[String] =
69957
e3217c6d6467 updated docker setup: lib32stdc++6 is no longer required for polyml-5.8, libfontconfig1 is required for headless jdk-11;
wenzelm
parents: 69873
diff changeset
    18
    List("curl", "less", "libfontconfig1", "libgomp1", "libwww-perl", "rlwrap", "unzip")
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
    19
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
    20
  val package_collections: Map[String, List[String]] =
64895
ad3b66e7a028 clarified packages;
wenzelm
parents: 64894
diff changeset
    21
    Map("X11" -> List("libx11-6", "libxext6", "libxrender1", "libxtst6", "libxi6"),
ad3b66e7a028 clarified packages;
wenzelm
parents: 64894
diff changeset
    22
      "latex" -> List("texlive-fonts-extra", "texlive-latex-extra", "texlive-math-extra"))
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
    23
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    24
  def build_docker(progress: Progress,
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    25
    app_archive: String,
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    26
    base: String = default_base,
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    27
    logic: String = default_logic,
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    28
    no_build: Boolean = false,
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    29
    entrypoint: Boolean = false,
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    30
    output: Option[Path] = None,
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
    31
    more_packages: List[String] = Nil,
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    32
    tag: String = "",
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    33
    verbose: Boolean = false)
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    34
  {
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    35
    val isabelle_name =
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    36
      app_archive match {
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    37
        case Isabelle_Name(name) => name
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    38
        case _ => error("Cannot determine Isabelle distribution name from " + app_archive)
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    39
      }
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    40
    val is_remote = Url.is_wellformed(app_archive)
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    41
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    42
    val dockerfile =
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    43
      """## Dockerfile for """ + isabelle_name + """
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    44
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    45
FROM """ + base + """
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    46
SHELL ["/bin/bash", "-c"]
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    47
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    48
# packages
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    49
RUN apt-get -y update && \
64941
wenzelm
parents: 64906
diff changeset
    50
  apt-get install -y """ + Bash.strings(packages ::: more_packages) + """ && \
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    51
  apt-get clean
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    52
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    53
# user
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    54
RUN useradd -m isabelle && (echo isabelle:isabelle | chpasswd)
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    55
USER isabelle
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    56
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    57
# Isabelle
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    58
WORKDIR /home/isabelle
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    59
""" +
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    60
 (if (is_remote)
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    61
   "RUN curl --fail --silent " + Bash.string(app_archive) + " > Isabelle.tar.gz"
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    62
  else "COPY Isabelle.tar.gz .") +
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    63
"""
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    64
RUN tar xzf Isabelle.tar.gz && \
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    65
  mv """ + isabelle_name + """ Isabelle && \
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    66
  perl -pi -e 's,ISABELLE_HOME_USER=.*,ISABELLE_HOME_USER="\$USER_HOME/.isabelle",g;' Isabelle/etc/settings && \
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    67
  perl -pi -e 's,ISABELLE_LOGIC=.*,ISABELLE_LOGIC=""" + logic + """,g;' Isabelle/etc/settings && \
69873
6ebe97815275 proper option (amending cc0b3e177b49);
wenzelm
parents: 68738
diff changeset
    68
  Isabelle/bin/isabelle build -o system_heaps -b """ + logic +
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    69
 (if (entrypoint) """
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    70
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    71
ENTRYPOINT ["Isabelle/bin/isabelle"]
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    72
"""
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
    73
  else "")
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    74
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    75
    output.foreach(File.write(_, dockerfile))
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    76
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    77
    if (!no_build) {
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    78
      Isabelle_System.with_tmp_dir("docker")(tmp_dir =>
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    79
        {
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    80
          File.write(tmp_dir + Path.explode("Dockerfile"), dockerfile)
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
    81
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    82
          if (is_remote) {
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    83
            if (!Url.is_readable(app_archive))
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    84
              error("Cannot access remote archive " + app_archive)
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    85
          }
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    86
          else File.copy(Path.explode(app_archive), tmp_dir + Path.explode("Isabelle.tar.gz"))
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    87
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    88
          val quiet_option = if (verbose) "" else " -q"
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    89
          val tag_option = if (tag == "") "" else " -t " + Bash.string(tag)
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    90
          progress.bash("docker build" + quiet_option + tag_option + " " + File.bash_path(tmp_dir),
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    91
            echo = true).check
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    92
        })
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
    93
    }
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    94
  }
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    95
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    96
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    97
  /* Isabelle tool wrapper */
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    98
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
    99
  val isabelle_tool =
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   100
    Isabelle_Tool("build_docker", "build Isabelle docker image", args =>
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   101
    {
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   102
      var base = default_base
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   103
      var entrypoint = false
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   104
      var logic = default_logic
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
   105
      var no_build = false
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   106
      var output: Option[Path] = None
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
   107
      var more_packages: List[String] = Nil
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   108
      var verbose = false
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   109
      var tag = ""
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   110
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   111
      val getopts =
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   112
        Getopts("""
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   113
Usage: isabelle build_docker [OPTIONS] APP_ARCHIVE
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   114
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   115
  Options are:
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   116
    -B NAME      base image (default """ + quote(default_base) + """)
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   117
    -E           set bin/isabelle as entrypoint
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   118
    -P NAME      additional Ubuntu package collection (""" +
64895
ad3b66e7a028 clarified packages;
wenzelm
parents: 64894
diff changeset
   119
          package_collections.keySet.toList.sorted.map(quote(_)).mkString(", ") + """)
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   120
    -l NAME      default logic (default ISABELLE_LOGIC=""" + quote(default_logic) + """)
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
   121
    -n           no docker build
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   122
    -o FILE      output generated Dockerfile
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   123
    -p NAME      additional Ubuntu package
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   124
    -t TAG       docker build tag
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   125
    -v           verbose
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   126
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   127
  Build Isabelle docker image with default logic image, using a standard
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
   128
  Isabelle application archive for Linux (local file or remote URL).
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   129
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
   130
  Examples:
64895
ad3b66e7a028 clarified packages;
wenzelm
parents: 64894
diff changeset
   131
69957
e3217c6d6467 updated docker setup: lib32stdc++6 is no longer required for polyml-5.8, libfontconfig1 is required for headless jdk-11;
wenzelm
parents: 69873
diff changeset
   132
    isabelle build_docker -E -t test/isabelle:Isabelle2019 Isabelle2019_linux.tar.gz
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
   133
69957
e3217c6d6467 updated docker setup: lib32stdc++6 is no longer required for polyml-5.8, libfontconfig1 is required for headless jdk-11;
wenzelm
parents: 69873
diff changeset
   134
    isabelle build_docker -E -n -o Dockerfile http://isabelle.in.tum.de/dist/Isabelle2019_linux.tar.gz
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
   135
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   136
""",
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   137
          "B:" -> (arg => base = arg),
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   138
          "E" -> (_ => entrypoint = true),
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   139
          "P:" -> (arg =>
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   140
            package_collections.get(arg) match {
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
   141
              case Some(ps) => more_packages :::= ps
64894
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   142
              case None => error("Unknown package collection " + quote(arg))
6c6bb62702d4 clarified packages;
wenzelm
parents: 64893
diff changeset
   143
            }),
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   144
          "l:" -> (arg => logic = arg),
64906
49549acbf025 added option -n, e.g. useful to generate Dockerfile only;
wenzelm
parents: 64905
diff changeset
   145
          "n" -> (_ => no_build = true),
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   146
          "o:" -> (arg => output = Some(Path.explode(arg))),
64899
749d3a86c6a3 clarified signature: packages may be accessed in Isabelle/Scala;
wenzelm
parents: 64897
diff changeset
   147
          "p:" -> (arg => more_packages ::= arg),
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   148
          "t:" -> (arg => tag = arg),
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   149
          "v" -> (_ => verbose = true))
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   150
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   151
      val more_args = getopts(args)
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   152
      val app_archive =
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   153
        more_args match {
64905
5e2eb9b14bbe support for remote APP_ARCHIVE, with self-contained Dockerfile (e.g. for Docker Hub);
wenzelm
parents: 64903
diff changeset
   154
          case List(arg) => arg
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   155
          case _ => getopts.usage()
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   156
        }
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   157
64942
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   158
      build_docker(new Console_Progress(), app_archive, base = base, logic = logic,
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   159
        no_build = no_build, entrypoint = entrypoint, output = output,
bae35a568b1b more options;
wenzelm
parents: 64941
diff changeset
   160
        more_packages = more_packages, tag = tag, verbose = verbose)
66790
c0e68e6a1beb build_docker is regular tool (non-admin);
wenzelm
parents: 66785
diff changeset
   161
    })
64890
d8ccbd5305bf build docker image from Isabelle application bundle for Linux;
wenzelm
parents:
diff changeset
   162
}