diff --git a/src/sphinx/DetailedTopics/debian.rst b/src/sphinx/DetailedTopics/debian.rst deleted file mode 100644 index be4339650..000000000 --- a/src/sphinx/DetailedTopics/debian.rst +++ /dev/null @@ -1,188 +0,0 @@ -Debian -====== -The debian package specification is very robust and powerful. If you wish to do any advanced features, it's best to understand how -the underlying packaging system works. http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ is an excellent tutorial. - - - -Getting Started ---------------- -By default, the debian packaging settings will take all files under ``src/debian/DEBIAN`` and map them into the debian control directory. -Make sure you have to following tools installed on your machine in order to build debian packages natively: - -* dpkg-deb -* dpkg-sig -* dpkg-genchanges -* lintian -* fakeroot - -If you are on windows you can try to use the jdeb packaging described below. - -Settings --------- - -Debian requires the following specific settings: - - ``name in Debian`` - The name of the package for debian (if different from general linux name). - - ``version in Debian`` - The debian-friendly version of the package. Should be of the form ``x.y.z-build-aa``. - - ``debianPackageDependencies in Debian`` - The list of debian packages that this package depends on. - - ``debianPackageRecommends in Debian`` - The list of debian packages that are recommended to be installed with this package. - - ``linuxPackageMappings in Debian`` - Debian requires a ``/usr/share/doc/{package name}/changelog.gz`` file that describes - the version changes in this package. These should be appended to the base linux versions. - - ``debianMaintainerScripts`` - These are the packaging scripts themselves used by ``dpkg-deb`` to build your debian. These - scripts are used when installing/uninstalling a debian, like prerm, postinstall, etc. These scripts - are placed in the ``DEBIAN`` file when building. Some of these files can be autogenerated, - for example when using a package archetype, like server_application. Howeve, any autogenerated file - can be overridden by placing your own files in the ``src/debian/DEBIAN`` directory. - - ``changelog in Debian`` - This is the changelog used by ``dpkg-genchanges`` to create the .changes file. This will allow you to - upload the debian package to a mirror. - - -Tasks ------ - -The Debian support grants the following commands: - - ``debian:package-bin`` - Generates the ``.deb`` package for this project. - - ``debian:lintian`` - Generates the ``.deb`` file and runs the ``lintian`` command to look for issues in the package. Useful for debugging. - - ``debian:gen-changes`` - Generates the ``.changes``, and therefore the ``.deb`` package for this project. - - -Examples --------- - -Plain Debian Packaging -~~~~~~~~~~~~~~~~~~~~~~ - -For a basic debian packaging your ``build.sbt`` must contain the following settings - -.. code-block:: scala - - import NativePackagerKeys._ - - name := "Debian Example" - - version := "1.0" - - packageArchetype.java_application - - maintainer := "Max Smith " - - packageSummary := "Hello World Debian Package" - - packageDescription := """A fun package description of our software, - with multiple lines.""" - -When you run ``sbt debian:packageBin`` you will find a debian package in your ``target`` folder. - -Multi OS Packaging with Debian -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you package for multiple operating systems you may have to be a bit more explicit in your ``build.sbt``. -For example - -.. code-block:: scala - - import NativePackagerKeys._ - - name := "Example Package" - - version := "1.0" - - packageArchetype.java_application - - maintainer in Debian := "Max Smith " - - maintainer in Windows := "Jane Smith " - - packageSummary in Debian := "Hello World Debian Package" - - packageSummary in Windows := "Hello World Windows Package" - - packageDescription := """A fun package description of our software, - with multiple lines.""" - -As you see, we duplicated the ``maintainer`` and ``packageSummary`` setting, but defined it for -different configuration scopes. - -Customizing Debian Packaging -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A Debian package provides metadata, which includes **dependencies** and **recommendations**. -A basic example to depend on java and recommend a git installation. - -.. code-block:: scala - - debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") - - debianPackageRecommends in Debian += "git" - -To hook into the debian package lifecycle (https://wiki.debian.org/MaintainerScripts) you -can add ``preinst`` , ``postinst`` , ``prerm`` and/or ``postrm`` scripts. Just place them into -``src/debian/DEBIAN``. - -If you use the ``packageArchetype.java_server`` there are predefined ``postinst`` and -``preinst`` files, which start/stop the application on install/remove calls. Existing -maintainer scripts will be extended not overridden. - -Your control scripts are in a different castle.. directory? No problem. - -.. code-block:: scala - - debianControlScriptsDirectory <<= (sourceDirectory) apply (_ / "deb" / "control") - -Customizing Debian Server Archetype -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The debian packaging supports the ``packageArchetype.java_server``, which generates -autostart scripts and some default links for logging and configuration. - -The default configuration looks like this (that means you don't have to add anything!) - -.. code-block:: scala - - import com.typesafe.sbt.packager.archetypes.ServerLoader.{Upstart, SystemV} - - serverLoading := Upstart - -The default configuration will create a default system user and group for ownerships of the -installed files. This user will also be used to execute the daemon service so it does -not run as the **root** user. - -This default can be overridden using the ``appUser`` and ``appGroup`` keys, change -these values as you need. The user or group you define in the appropriate keys will be -created within in the ``postinst`` script and removed with ``apt-get purge`` through the -``postrm`` script. - -For more information look at the :ref:`Archetypes` page. - -Use JDeb for Debian Packaging -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If don't run a linux or mac system with ``dpkg`` installed, you can configure the -debian packaging be done by `jdeb`_ . To enable this just set another packaging -implementation in your ``build.sbt`` - -.. code-block:: scala - - packageBin in Debian <<= debianJDebPackaging in Debian - -.. _jdeb: https://github.com/tcurdt/jdeb diff --git a/src/sphinx/DetailedTopics/docker.rst b/src/sphinx/DetailedTopics/docker.rst deleted file mode 100644 index 3177305e5..000000000 --- a/src/sphinx/DetailedTopics/docker.rst +++ /dev/null @@ -1,93 +0,0 @@ -Docker -====== - -Docker images describe how to set up a container for running an application, including what files are present, and what program to run. - - https://docs.docker.com/introduction/understanding-docker/ provides an introduction to Docker. - https://docs.docker.com/reference/builder/ describes the Dockerfile; a file which describes how to set up the image. - - sbt-native-packager focuses on creating a Docker image which can "just run" the application built by SBT. - -Settings --------- - -Docker images require the following setting: - -.. code-block:: scala - - import NativePackagerKeys._ - maintainer in Docker := "John Smith " - -It may require these settings: - -.. code-block:: scala - - packageName in Docker := packageName.value, - version in Docker := version.value, - dockerBaseImage := "dockerfile/java", - dockerRepository := Some("dockeruser"), - dockerExposedPorts in Docker := Seq(9000, 9443), - dockerExposedVolumes in Docker := Seq("/opt/docker/logs") - -Informational Settings -~~~~~~~~~~~~~~~~~~~~~~ - - - ``packageName in Docker`` - The name of the package for Docker (if different from general name). - This will only affect the image name. - - ``version in Docker`` - The version of the package for Docker (if different from general version). Often takes the form ``x.y.z``. - - ``maintainer in Docker`` - The maintainer of the package, required by the Dockerfile format. - -Environment Settings -~~~~~~~~~~~~~~~~~~~~ - - ``dockerBaseImage`` - The image to use as a base for running the application. It should include binaries on the path for ``chown``, ``mkdir``, have a discoverable ``java`` binary, and include the user configured by ``daemonUser`` (``daemon``, by default). - - ``daemonUser in Docker`` - The user to use when executing the application. Files below the install path also have their ownership set to this user. - - ``dockerExposedPorts in Docker`` - A list of ports to expose from the Docker image. - - ``dockerExposedVolumes in Docker`` - A list of data volumes to make available in the Docker image. - - ``dockerEntrypoint in Docker`` - Overrides the default entrypoint for docker-specific service discovery tasks before running the application. - Defaults to the bash executable script, available at ``bin/