From a5fd8e33ab6b49241f62054406dcdeeee6e0c08d Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 19 Jan 2024 14:34:28 +0100 Subject: [PATCH 01/23] Added podman-docker, Compose brief intro. --- articles/docker-compose.asm.xml | 207 ++++++++++++++++++ concepts/docker-compose-about.xml | 62 ++++++ concepts/docker-compose-podman-docker.xml | 35 +++ ...ker-compose-podman-docker-installation.xml | 46 ++++ 4 files changed, 350 insertions(+) create mode 100644 articles/docker-compose.asm.xml create mode 100644 concepts/docker-compose-about.xml create mode 100644 concepts/docker-compose-podman-docker.xml create mode 100644 tasks/docker-compose-podman-docker-installation.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml new file mode 100644 index 000000000..564a21045 --- /dev/null +++ b/articles/docker-compose.asm.xml @@ -0,0 +1,207 @@ + + + + + %entities; +]> + + + + + + + + + + Glue example + + + Glue for more information + + + Glue what's next + + + + + + About docker-compose + + + + + + Installing dpodman-docker + + + + + + Reference example + + + + + + Legal Notice + + + GNU Free Documentation License + + + + + + Managing multi-container applications using <literal>docker-compose</literal> + Subtitle if necessary + + + + 2054-11-14 + + + + Added sections: + + + + New section on foo to resolve issue bsc#12345 + + New section on foo bar + + + Removed sections: + + Removed section on foo1 to resolve issue bsc#12346 + Removed section on foo1 bar + + + Changed sections: + + Changed section on foo2 to resolve issue bsc#12347 + Changed section on foo2 bar + + + + + + + + + + + + + + + + + + &productname; + + short title for SEO and social media, max. 55 chars + short description, max. 150 chars + ultrashort description for social media, max 55 chars + + + + + https://bugzilla.suse.com/enter_bug.cgi + Smart Docs + Documentation + + maintainer@suse.com + + yes + + + + + WHAT? + + + Describe your topic in one sentence. + + + + + WHY? + + + State the reason why one should read this. + + + + + EFFORT + + + What's the effort one has to put in? + + + + + GOAL + + + What's the reader's take-away from this article? + + + + + REQUIREMENTS + + + + + List the requirements to accomplish the task(s) described below. + + + + + + + + + + + + + + + + You are a very special concept now! + + + + + + + + + + + + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml new file mode 100644 index 000000000..036bc16ca --- /dev/null +++ b/concepts/docker-compose-about.xml @@ -0,0 +1,62 @@ + + + + + %entities; +]> + + + + + + + Overview of Compose + + + + + Introductory text + + + +
+ What is Compose? + + Compose is a tool for managing multi-container applications. Compose enables you to + have multiple isolated environment on a single host, recreate only those containers that have + changed and supporit variables between environments. + +
+
+ How does Compose work? + + First, you need to create a YAML file that define your application. Computing components of + the application are commonly called services - run of a container image and configuraiton. + +
+ A figure + + + + + + + + +
+
+
+ Benefits of foo bar + + A paragraph of text, pointing out the benefits of foo bar. + +
+
diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml new file mode 100644 index 000000000..7db15d426 --- /dev/null +++ b/concepts/docker-compose-podman-docker.xml @@ -0,0 +1,35 @@ + + + + + %entities; +]> + + + + + + + About <literal>podman-docker</literal> + + + + + Introductory text + + + + + podman-docker is a bash script that enables you to run all your docker commands + in an environment, where &podman; is the used container engine. The script changes any docker + command you run into a corresponding podman command with the same passed arguments. + + diff --git a/tasks/docker-compose-podman-docker-installation.xml b/tasks/docker-compose-podman-docker-installation.xml new file mode 100644 index 000000000..dcb02ad21 --- /dev/null +++ b/tasks/docker-compose-podman-docker-installation.xml @@ -0,0 +1,46 @@ + + + + + %entities; +]> + + + + + + + Installation of <literal>podman-docker</literal> + + + + + The topic covers installation of podman-docker. + + + + The podman-docker is not installed on &productnameshort; by default. To + install it proceed as follows: + + + + Install the package podman-docker by running: + + transactional-update pkg install podman-docker + + + + Reboot the system to switch to the latest snapshot. + + + + From 6a45e96851e9d25ce59a141b8455ad68b87f265b Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Mon, 22 Jan 2024 13:37:04 +0100 Subject: [PATCH 02/23] Added environment variables. --- concepts/docker-compose-about.xml | 52 +++++++++++++++++--------- concepts/podman-about.xml | 61 +++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 concepts/podman-about.xml diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 036bc16ca..49bc38ffe 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -38,25 +38,43 @@
How does Compose work? - First, you need to create a YAML file that define your application. Computing components of - the application are commonly called services - run of a container image and configuraiton. + First, you need to create a YAML file that define your application. In the file, you need to + define the following components: Computing components of + the application are commonly called services - run of a container image and configuration. + + + + service + + + A service is a computing component of the application. It is a run of a container image + with a partiular configuration. + + + + + network + + + Networks define IP routes between services. + + + + + volume + + + A directory where services store and shares data. + + + + + + You may also need to use a list of environment variables that will be passed to your services. -
- A figure - - - - - - - - -
-
-
- Benefits of foo bar - A paragraph of text, pointing out the benefits of foo bar. + After you create the YAML file, you can manage your compose application using the compose CLI.
+ diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml new file mode 100644 index 000000000..b85caf815 --- /dev/null +++ b/concepts/podman-about.xml @@ -0,0 +1,61 @@ + + + + + %entities; +]> + + + + + + + Concept + + + + + Introductory text + + + +
+ What is foo bar? + + A paragraph of text, answering the question above and explaining the + aim/function of foo bar. + +
+
+ How does foo bar work? + + A paragraph of text, answering the question above and explaining the + mechanism behind foo bar. + +
+ A figure + + + + + + + + +
+
+
+ Benefits of foo bar + + A paragraph of text, pointing out the benefits of foo bar. + +
+
From b1a12c8bff95a632c954754553113ef48568871c Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Mon, 22 Jan 2024 16:33:01 +0100 Subject: [PATCH 03/23] Added Podman installation. --- articles/docker-compose.asm.xml | 9 +- concepts/docker-compose-about.xml | 13 ++- concepts/podman-about.xml | 53 +++++------ tasks/docker-compose-create-application.xml | 98 +++++++++++++++++++++ tasks/podman-installation.xml | 48 ++++++++++ 5 files changed, 181 insertions(+), 40 deletions(-) create mode 100644 tasks/docker-compose-create-application.xml create mode 100644 tasks/podman-installation.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 564a21045..e006c63d9 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -34,11 +34,18 @@ About docker-compose + + About docker-compose + + - Installing dpodman-docker + Installing podman-docker + + + Installing podman-docker diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 49bc38ffe..b5ad3a7e0 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -20,10 +20,10 @@ Overview of Compose - + - Introductory text + The topic describes basics of the Compose tool. @@ -39,12 +39,11 @@ How does Compose work? First, you need to create a YAML file that define your application. In the file, you need to - define the following components: Computing components of - the application are commonly called services - run of a container image and configuration. + define the following components: - service + Service A service is a computing component of the application. It is a run of a container image @@ -53,7 +52,7 @@ - network + Network Networks define IP routes between services. @@ -61,7 +60,7 @@ - volume + Volume A directory where services store and shares data. diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index b85caf815..90401f8e1 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -10,7 +10,7 @@ - Concept - + Introductory text -
- What is foo bar? - - A paragraph of text, answering the question above and explaining the - aim/function of foo bar. - -
-
- How does foo bar work? - - A paragraph of text, answering the question above and explaining the - mechanism behind foo bar. - -
- A figure - - - - - - - - -
-
-
- Benefits of foo bar - - A paragraph of text, pointing out the benefits of foo bar. - + + Podman is a short name for Pod Manager Tool. It is a daemonless container + engine that enables you to run and deploy applications using containers + and container images. Podman provides a command line interface to manage + containers. + + + As Podman does not have a daemon, it provides integration with systemd. + This makes it possible to control containers via systemd units. You can + create these units for existing containers as well as generate units that + can start containers if they do not exist in the system. Moreover, Podman + can run systemd inside containers. + + + Podman enables you to organize your containers into pods. Pods share the + same network interface and resources. A typical use case for organizing a + group of containers into a pod is a container that runs a database and a + container with a client that accesses the database. +
diff --git a/tasks/docker-compose-create-application.xml b/tasks/docker-compose-create-application.xml new file mode 100644 index 000000000..e0cbbf7d2 --- /dev/null +++ b/tasks/docker-compose-create-application.xml @@ -0,0 +1,98 @@ + + + + + %entities; +]> + + + + + + + Creating a containers-based application. + + + + + By using Compose you can create and start a container-based application. + + + +
+ Introduction + + A paragraph of text. + +
+
+ Requirements + + + + An + + + + + Unordered + + + + + List + + + + + A paragraph of text. + +
+
+ Executing the task + + A paragraph of text. + + + + A short introduction to the procedure. + + + + A step. + + + + + A second step. + + + + + A third step. + + + +
+
+ Summary + + A paragraph of text, summing up the result of the task. + +
+
+ Troubleshooting + + Add some troubleshooting information, if applicable. + +
+
diff --git a/tasks/podman-installation.xml b/tasks/podman-installation.xml new file mode 100644 index 000000000..ebddbfb4a --- /dev/null +++ b/tasks/podman-installation.xml @@ -0,0 +1,48 @@ + + + + + %entities; +]> + + + + + + + Executing task X (with tool Y) + + + + + Introductory text + + + + + &podman; is on &productnameshort; present by default. However, if in any case &podman; is + missing, you can install it as described bellow: + + + + + Run the command: + + &prompt.root;transactional-update pkg install podman* + + + + Restart your system to boot into the new snapshot. + + + + From 9839cb4daa3823e0900951c733f36e89378fac4e Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Tue, 23 Jan 2024 15:30:47 +0100 Subject: [PATCH 04/23] Added an entity. --- articles/docker-compose.asm.xml | 8 +- concepts/docker-compose-about.xml | 24 +++--- concepts/podman-about.xml | 2 +- references/docker-compose-yaml-file.xml | 77 ++++++++++++++++++ tasks/docker-compose-create-application.xml | 88 +++++---------------- 5 files changed, 118 insertions(+), 81 deletions(-) create mode 100644 references/docker-compose-yaml-file.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index e006c63d9..13c16fb28 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -32,10 +32,10 @@ - About docker-compose + About &compose; - About docker-compose + About &compose; @@ -66,8 +66,8 @@ - Managing multi-container applications using <literal>docker-compose</literal> - Subtitle if necessary + Managing multi-container applications using <literal>&compose;</literal> + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index b5ad3a7e0..59ab5cab6 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -10,7 +10,7 @@ - - Overview of Compose + Overview of &compose; - The topic describes basics of the Compose tool. + The topic describes basics of the &compose; tool. -
- What is Compose? +
+ What is &compose;? - Compose is a tool for managing multi-container applications. Compose enables you to + &compose; is a tool for managing multi-container applications. &compose; enables you to have multiple isolated environment on a single host, recreate only those containers that have changed and supporit variables between environments.
-
- How does Compose work? +
+ How does &compose; work? First, you need to create a YAML file that define your application. In the file, you need to define the following components: @@ -72,7 +72,13 @@ You may also need to use a list of environment variables that will be passed to your services. - After you create the YAML file, you can manage your compose application using the compose CLI. + After you create the YAML file, you can manage your application using the &compose; CLI. + +
+
+ Where to get &compose;? + + &compose; is present on &productnameshort; by default and can be used out of the box.
diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index 90401f8e1..d42064425 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Concept + About &podman; diff --git a/references/docker-compose-yaml-file.xml b/references/docker-compose-yaml-file.xml new file mode 100644 index 000000000..553d63f56 --- /dev/null +++ b/references/docker-compose-yaml-file.xml @@ -0,0 +1,77 @@ + + + + + %entities; +]> + + + + + + + The <filename>compose.yml</filename> file + + + + + Introductory text + + + + +
+ The + + A paragraph of text. + + + A title + + a-command --with-options + + + A paragraph of text. + + + + + another-command --with-options + + + Another paragraph of text. + + + + + + A table title + + + + + + an entry + another entry + + + an entry + another entry + + + an entry + another entry + + + +
+
+
diff --git a/tasks/docker-compose-create-application.xml b/tasks/docker-compose-create-application.xml index e0cbbf7d2..203b042af 100644 --- a/tasks/docker-compose-create-application.xml +++ b/tasks/docker-compose-create-application.xml @@ -10,7 +10,7 @@ - - By using Compose you can create and start a container-based application. + By using &compose; you can create and start a container-based application.
-
- Introduction - - A paragraph of text. - -
-
- Requirements - - - - An - - - - - Unordered - - - - - List - - - - - A paragraph of text. - -
-
- Executing the task - - A paragraph of text. - - + + The procedure of creating and starting a container-based application can be summarized into the following steps: + + + - A short introduction to the procedure. +Prepare the compose.yml file. - - - A step. - - - - - A second step. - - - - - A third step. - - - -
-
- Summary - - A paragraph of text, summing up the result of the task. - -
-
- Troubleshooting - - Add some troubleshooting information, if applicable. - -
+ + + + Prepare the environment variables file. + + + + + Use &compose; to start the application. + + + + From ecfdb1fa213c3b7ff1c6beb8e38744264fff5250 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Wed, 24 Jan 2024 16:19:12 +0100 Subject: [PATCH 05/23] Added compose.yml file. --- references/docker-compose-yaml-file.xml | 55 +++++++++++-------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/references/docker-compose-yaml-file.xml b/references/docker-compose-yaml-file.xml index 553d63f56..7c3a5ba53 100644 --- a/references/docker-compose-yaml-file.xml +++ b/references/docker-compose-yaml-file.xml @@ -27,51 +27,44 @@ - -
- The + + The compose.yml is preferably placed in the working directory. It can be + either a single file or you can use more granular approach by utilizing fragments and + extensions. Multiple &compose; files can be also merged together to define the whole application model. + +
+ Service definition - A paragraph of text. + Each service is defined as a container image to use and a set of runtime arguments. Start + the services definition by adding the services as the top level element to + the compose.yml file. Other elements are described below: - A title + Service definition elements/title> <varlistentry> - <term><command>a-command --with-options</command></term> + <term><literal>build</literal></term> <listitem> <para> - A paragraph of text. + Specifies how to create a container image that is later used to start the service. </para> </listitem> </varlistentry> <varlistentry> - <term><command>another-command --with-options</command></term> + <term><literal>image</literal></term> <listitem> <para> - Another paragraph of text. + Define the container image to use to start the service. </para> </listitem> </varlistentry> - </variablelist> - <table> - <title>A table title - - - - - - an entry - another entry - - - an entry - another entry - - - an entry - another entry - - - - + +
+
+ Networks definition + + +
+
+Volumes definition
From 2d82fc07a0c05c56d608449077dd980bc736e829 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Thu, 25 Jan 2024 11:49:53 +0100 Subject: [PATCH 06/23] Created the draft structure. --- DC-SLE-Micro-compose | 15 +++++++++ articles/docker-compose.asm.xml | 40 +++++++++++++++-------- concepts/docker-compose-podman-docker.xml | 3 +- concepts/podman-about.xml | 2 +- 4 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 DC-SLE-Micro-compose diff --git a/DC-SLE-Micro-compose b/DC-SLE-Micro-compose new file mode 100644 index 000000000..6971c437a --- /dev/null +++ b/DC-SLE-Micro-compose @@ -0,0 +1,15 @@ +## ---------------------------- +## Doc Config File for the DB Assembly +## ---------------------------- +## +## Basics +MAIN="docker-compose.asm.xml" +SRC_DIR="articles" + +## Profiling +PROFOS="slemicro" +#PROFARCH="x86_64;zseries;power;aarch64" + +## stylesheet location +STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2022-ns" +FALLBACK_STYLEROOT="/usr/share/xml/docbook/stylesheet/suse2021-ns" \ No newline at end of file diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 13c16fb28..581a42bb8 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -32,21 +32,28 @@ - About &compose; + About podman-docker About &compose; - + + About &podman; + + Installing podman-docker + + Creating a container-based application + Installing podman-docker + @@ -139,7 +146,7 @@ Smart Docs Documentation - maintainer@suse.com + jsindelarova@suse.com yes @@ -149,7 +156,7 @@ WHAT? - Describe your topic in one sentence. + You want to create a container-based application using &compose;. @@ -183,7 +190,12 @@ - List the requirements to accomplish the task(s) described below. + The application architecture. + + + + + Container images or its source files that are used to form the application. @@ -195,17 +207,17 @@ - + + + - - - You are a very special concept now! - + + - - - - + + + + diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml index 7db15d426..8d07228e1 100644 --- a/concepts/docker-compose-podman-docker.xml +++ b/concepts/docker-compose-podman-docker.xml @@ -23,7 +23,8 @@ - Introductory text + As &productnameshort; uses &podman; to manage containers, you may face a problem that your + scripts use Docker. To avoid changing your Docker scripts, you can use podman-docker. diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index d42064425..abbe5d386 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -23,7 +23,7 @@ - Introductory text + The topic covers an introduction to &podman;. From ef194b9107def51de6d400e2a772da7da6655183 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 26 Jan 2024 09:28:38 +0100 Subject: [PATCH 07/23] doc-kit fetch update. --- common/generic-entities.ent | 18 +++--------------- concepts/podman-about.xml | 2 +- doc-kit.conf | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/common/generic-entities.ent b/common/generic-entities.ent index 3763a720f..8cbf05fc5 100644 --- a/common/generic-entities.ent +++ b/common/generic-entities.ent @@ -209,25 +209,12 @@ use &deng;! --> + - - - - - - - - - - - - - - @@ -373,6 +360,7 @@ use &deng;! --> + @@ -624,4 +612,4 @@ use &deng;! --> - \ No newline at end of file + diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index abbe5d386..0d8baf456 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -46,5 +46,5 @@ group of containers into a pod is a container that runs a database and a container with a client that accesses the database. -
+ diff --git a/doc-kit.conf b/doc-kit.conf index f941a4b76..97a70752d 100644 --- a/doc-kit.conf +++ b/doc-kit.conf @@ -15,7 +15,7 @@ file: ccd4111fb11fe4fa272d565d22872dda991d48f7 templates/snippets/snippet_warni file: bc33a5462e82871906d98907a32d9e28d558dfaa templates/tasks/task.xml file: a694cf48c672db931339d607ce4176eee29682dc templates/topicmaps/example.xmind file: 093bd16b3acee829087711e1fdfd7d2bb8e2001c templates/topicmaps/example.png -file: 087cd3de86a5e0d519c86e344fe03b7b8ce39587 common/generic-entities.ent +file: b68e8cf0d6fb671578684779ef7a9b5cdbe79641 common/generic-entities.ent file: a79a3bc929478668955564bab48aecc8502555f6 common/network-entities.ent file: 88bbd2edf1ecc4e5098a443a53e1560625cbeabe common/legal.xml file: 092bac4c1160db059d3054774b8271663503f0d0 common/license_gfdl1.2.xml From 6090cef368fb1a4cefbd6e2ce9eeaa717d1134e6 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 26 Jan 2024 10:40:51 +0100 Subject: [PATCH 08/23] Added the procedure how to create an application. --- tasks/docker-compose-create-application.xml | 27 ++++++++++++++++++++- tasks/podman-installation.xml | 6 ++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/tasks/docker-compose-create-application.xml b/tasks/docker-compose-create-application.xml index 203b042af..620c6b580 100644 --- a/tasks/docker-compose-create-application.xml +++ b/tasks/docker-compose-create-application.xml @@ -39,7 +39,7 @@ Prepare the compose.yml file. - Prepare the environment variables file. + Optionally, prepare the environment variables file. @@ -48,5 +48,30 @@ Prepare the compose.yml file. +
+ Preparing the <filename>compose.yml</filename> file + + + + For a complete specification, refer to the &compose; file specification. + +
+
+ Starting the application + + In the directory, where compose.yml reside, run: + + &prompt.root;compose up [OPTIONS] + [SERVICE] + + The recommended option is as it starts the containers in detached state. + Otherwise, the containers exit as soon as the command is terminated. + + +
diff --git a/tasks/podman-installation.xml b/tasks/podman-installation.xml index ebddbfb4a..c106b1857 100644 --- a/tasks/podman-installation.xml +++ b/tasks/podman-installation.xml @@ -18,13 +18,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Executing task X (with tool Y) - + - Introductory text + The topic covers installation of &podman;. From dfa90175f0bb631f5088d6064afbfba655988ba5 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Mon, 26 Feb 2024 17:05:18 +0100 Subject: [PATCH 09/23] Creating an example app split into a separate file. --- articles/docker-compose.asm.xml | 30 +++- concepts/docker-compose-about.xml | 20 ++- tasks/docker-compose-creating-application.xml | 136 ++++++++++++++++++ 3 files changed, 171 insertions(+), 15 deletions(-) create mode 100644 tasks/docker-compose-creating-application.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 581a42bb8..7f1b9d29e 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -208,14 +208,36 @@ + + + + + + + + + + - - - + - + + + + + + + + + + + + + + + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 59ab5cab6..acfcf08ba 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -27,14 +27,18 @@ -
- What is &compose;? - + &compose; is a tool for managing multi-container applications. &compose; enables you to have multiple isolated environment on a single host, recreate only those containers that have changed and supporit variables between environments. -
+
+ Installing &compose; + + &compose; is present on &productnameshort; by default and can be used out of the box. + +
+
How does &compose; work? @@ -74,12 +78,6 @@ After you create the YAML file, you can manage your application using the &compose; CLI. -
-
- Where to get &compose;? - - &compose; is present on &productnameshort; by default and can be used out of the box. - -
+
diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml new file mode 100644 index 000000000..6848d7aa0 --- /dev/null +++ b/tasks/docker-compose-creating-application.xml @@ -0,0 +1,136 @@ + + + + + %entities; +]> + + + + + + + Creating a container-based application + + + + + &compose; enables you to create a containerized application that uses several containers. + + + + +
+ Creating <filename>compose. yml</filename> + + To create the application, you need to create a YAML file that defines your application. The + compose.yml file should include the following parts. + + + + Service + + + A service is a computing component of the application. It is a run of a container image + with a partiular configuration. + + + + + Network + + + Networks define IP routes between services. + + + + + Volume + + + A directory where services store and shares data. + + + + + Environment variables + + + You may also need to use a list of environment variables that will be passed to your services. + + + + + + For example, to define an application that uses the Prometheus monitoring system and the + Grafana analytics system, create a compose.yml similar to the following. + + + services: + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ./prometheus:/etc/prometheus + - prom_data:/prometheus + grafana: + image: grafana/grafana + container_name: grafana + ports: + - 3000:3000 + restart: unless-stopped + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=grafana + volumes: + - ./grafana:/etc/grafana/provisioning/datasources +volumes: + prom_data: + + + The project structure in this example must look like follows: + + +. +├── compose.yaml +├── grafana +│   └── datasource.yml +├── prometheus +│   └── prometheus.yml +└── README.md + + + Images can be pulled automatically + +&podman; checks if the image name declared in the compose.yml file is located +locally. If it is not, &podman; pulls the image from configured registries. + + +
+
+ Deploying applications + + After you create the proper directory structure and the compose.yml + file, you can deploy the application by running: + + &prompt.user;podman compose up -d + + You can verify that containers are running and ports are mapped by listing running containers: + + &prompt.user;podman ps +
+
From fba5731c72982900b8ee7adf0c373f902859a949 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Tue, 27 Feb 2024 14:54:21 +0100 Subject: [PATCH 10/23] Added installation of docker-compose. --- articles/docker-compose.asm.xml | 27 ++++++++-- concepts/docker-compose-about.xml | 49 ++----------------- tasks/docker-compose-creating-application.xml | 34 +++++++++++-- tasks/docker-compose-installing-compose.xml | 40 +++++++++++++++ 4 files changed, 95 insertions(+), 55 deletions(-) create mode 100644 tasks/docker-compose-installing-compose.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 7f1b9d29e..0506fda4b 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -53,8 +53,13 @@ Installing podman-docker - - + + Creating containerized applications + + + Creating containerized applications + + @@ -213,12 +218,13 @@ - + + @@ -237,7 +243,20 @@ - + + + + + + + + + + + + + + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index acfcf08ba..01f797a3a 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -32,52 +32,9 @@ have multiple isolated environment on a single host, recreate only those containers that have changed and supporit variables between environments. -
- Installing &compose; - - &compose; is present on &productnameshort; by default and can be used out of the box. - -
- -
- How does &compose; work? - - First, you need to create a YAML file that define your application. In the file, you need to - define the following components: - - - - Service - - - A service is a computing component of the application. It is a run of a container image - with a partiular configuration. - - - - - Network - - - Networks define IP routes between services. - - - - - Volume - - - A directory where services store and shares data. - - - - - - You may also need to use a list of environment variables that will be passed to your services. - - After you create the YAML file, you can manage your application using the &compose; CLI. + On &productnameshort; the podman-docker script is used to call + &podman; whenever you run &compose;, as &docker; is not present on &productnameshort;. -
- + diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index 6848d7aa0..e3ee215bf 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -24,13 +24,37 @@ in the assembly --> - &compose; enables you to create a containerized application that uses several containers. - - + The topic covers a simple example of a containerized application. +
+ + To create a containerized application, proceed as follows: + + + + +Create the configuration file compose.yml. For details, refer to . + + + + + Prepare the required directory structure. + + + + + Prepare configuration of services used by the containerized application. + + + + + Deploy the application. For details, refer to . + + +
- Creating <filename>compose. yml</filename> + Creating <filename>compose.yml</filename> To create the application, you need to create a YAML file that defines your application. The compose.yml file should include the following parts. @@ -102,7 +126,7 @@ volumes: prom_data: - The project structure in this example must look like follows: + The project structure in this example must look as follows: . diff --git a/tasks/docker-compose-installing-compose.xml b/tasks/docker-compose-installing-compose.xml new file mode 100644 index 000000000..532c3dbcd --- /dev/null +++ b/tasks/docker-compose-installing-compose.xml @@ -0,0 +1,40 @@ + + + + + %entities; +]> + + + + + + + Installing &compose; + + + + + The topic covers installation of &compose; on &productnameshort;. + + + + + If &compose; is not pesent on your system, you can install it by running: + + + &prompt.sudo;transactional-update pkg install compose + + + After successful installation, reboot your system to boot into the new snapshot. + + From 779b4f9cab426a67be8053fe8ab7baadfd1867ec Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 1 Mar 2024 15:42:32 +0100 Subject: [PATCH 11/23] Added docker compose up procedure. --- articles/docker-compose.asm.xml | 5 +++ concepts/docker-compose-podman-docker.xml | 14 ++++--- tasks/docker-compose-creating-application.xml | 42 ++++++++++++++++--- tasks/docker-compose-installing-compose.xml | 15 +++++-- 4 files changed, 62 insertions(+), 14 deletions(-) diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 0506fda4b..d5e065b6c 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -229,6 +229,11 @@ + + + + + diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml index 8d07228e1..0f35c98b7 100644 --- a/concepts/docker-compose-podman-docker.xml +++ b/concepts/docker-compose-podman-docker.xml @@ -23,14 +23,18 @@ - As &productnameshort; uses &podman; to manage containers, you may face a problem that your - scripts use Docker. To avoid changing your Docker scripts, you can use podman-docker. + The topic covers the purpose of the podmna-docker tool. - podman-docker is a bash script that enables you to run all your docker commands - in an environment, where &podman; is the used container engine. The script changes any docker - command you run into a corresponding podman command with the same passed arguments. + As &productnameshort; uses &podman; to manage containers, you may face a problem if your + scripts use &docker;. To avoid changing your &docker; scripts, you can use + podman-docker. + + + podman-docker is a bash script that changes any docker + command you run into a corresponding podman command with the same passed + arguments.Therefore, you can use all your &docker; scripts without any modifications. diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index e3ee215bf..c9285004a 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -149,12 +149,42 @@ locally. If it is not, &podman; pulls the image from configured registries. Deploying applications After you create the proper directory structure and the compose.yml - file, you can deploy the application by running: + file, you can deploy the application: - &prompt.user;podman compose up -d - - You can verify that containers are running and ports are mapped by listing running containers: - - &prompt.user;podman ps + + + + Verify that there is no running copy of the container you intend to run: + + &prompt.user; podman ps + + If needed, remove the particular container: + + &prompt.user; podman rm -f CONTAINER_ID + + + + Start the application stack by running from the directory where compose.yml + is located: + &prompt.user;podman compose up -d + +&compose; creates a separata network for te application stack. + + + + + You can verify that containers are running and ports are mapped by listing running containers: + + &prompt.user;podman ps + + + + Exiting the application stack + +To exit the application stack, run the command: + + &prompt.user;docker compose down + +
diff --git a/tasks/docker-compose-installing-compose.xml b/tasks/docker-compose-installing-compose.xml index 532c3dbcd..d6943e094 100644 --- a/tasks/docker-compose-installing-compose.xml +++ b/tasks/docker-compose-installing-compose.xml @@ -29,12 +29,21 @@ in the assembly --> - If &compose; is not pesent on your system, you can install it by running: + If &compose; is not pesent on your system, you can install it by following the steps: + + + + Run the command: + - &prompt.sudo;transactional-update pkg install compose +&prompt.sudo;transactional-update pkg install compose + + - After successful installation, reboot your system to boot into the new snapshot. + After the installation is complete, reboot your system to boot into the new snapshot. + + From 692df19b2b413b4fe58af487a251edd5e4e85a3f Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Mon, 4 Mar 2024 15:04:49 +0100 Subject: [PATCH 12/23] Reworked creating the compose.yml file. --- concepts/docker-compose-about.xml | 7 +- references/docker-compose-yaml-reference.xml | 143 ++++++++++++++++++ tasks/docker-compose-creating-application.xml | 64 ++++++-- 3 files changed, 195 insertions(+), 19 deletions(-) create mode 100644 references/docker-compose-yaml-reference.xml diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 01f797a3a..0aa15170a 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -29,11 +29,12 @@ &compose; is a tool for managing multi-container applications. &compose; enables you to - have multiple isolated environment on a single host, recreate only those containers that have - changed and supporit variables between environments. + have multiple isolated environment on a single host, while it supports using variables + between environments. Using &compose; you can recreate only those containers that have + changed without destroyng the whole application stack. - On &productnameshort; the podman-docker script is used to call + On &productnameshort; the podman-docker script is used to call &podman; whenever you run &compose;, as &docker; is not present on &productnameshort;. diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml new file mode 100644 index 000000000..47b0a923c --- /dev/null +++ b/references/docker-compose-yaml-reference.xml @@ -0,0 +1,143 @@ + + + + + %entities; +]> + + + + + + + Creating <filename>compose.yml</filename> + + + + + Introductory text + + + + + To create the application, you need to create a compose.yml file that defines your application. The + file should include the following parts. + + + + service + + + A service is a computing component of the application. It is a run of a container image + with a particular configuration. For details regarding the definition, refer to + + + + + + networks + + + You can use the network statement to define custom networks and assign + particular services to custom networks. For details, refer to + + + + + + Volume + + + A directory where services store and shares data. + + + + + Environment variables + + + You may also need to use a list of environment variables that will be passed to your services. + + + + +
+ Services definition + + When defining services you either need to specify a container image to use by adding image, or use the + build statement and provide a container file to build the service from + source files. + + + Images can be pulled automatically + + &podman; checks if the image name declared in the compose.yml file is located + locally. If it is not, &podman; pulls the image from configured registries. + + + +
+
+ Networks definition + + By default, &compose; creates a default network and each + container in the application stack is included in the network. The default network does + not have to be declared in the compose.yml file as it is created + automatically by &compose;. + +
+
+ Example of <filename>compose.yml</filename> + + The following example of compose.yml defines an application stack that uses the Prometheus monitoring system and the + Grafana analytics system. + + + services: + prometheus: + image: prom/prometheus + container_name: prometheus + command: + - '--config.file=/etc/prometheus/prometheus.yml' + ports: + - 9090:9090 + restart: unless-stopped + volumes: + - ./prometheus:/etc/prometheus + - prom_data:/prometheus + grafana: + image: grafana/grafana + container_name: grafana + ports: + - 3000:3000 + restart: unless-stopped + environment: + - GF_SECURITY_ADMIN_USER=admin + - GF_SECURITY_ADMIN_PASSWORD=grafana + volumes: + - ./grafana:/etc/grafana/provisioning/datasources +volumes: + prom_data: + + + The project structure in this example must look as follows: + + +. +├── compose.yaml +├── grafana +│   └── datasource.yml +├── prometheus +│   └── prometheus.yml +└── README.md + +
+
diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index c9285004a..67a2ca751 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -39,12 +39,20 @@ Create the configuration file compose.yml. For details, ref - Prepare the required directory structure. + Prepare the required directory structure. We recommend that the + compose.yml file is located at the top of your working directory. + - Prepare configuration of services used by the containerized application. + If needed, prepare files specific to services used by the containerized application. For + exammple, if you intend to build your own service, create a containerfile. + Alternatively, include configuration files of the services being used. + + We + recommend to create a subdirectory per service in the working directory and place the + service-specific files there. @@ -61,19 +69,26 @@ Create the configuration file compose.yml. For details, ref - Service + service A service is a computing component of the application. It is a run of a container image - with a partiular configuration. + with a particular configuration. + + + When defining services you either need to specify a container image to use by adding image, or use the + build statement and provide a container file to build the service from + source files. - Network + networks - - Networks define IP routes between services. + + You can use the network statement to define custom networks and assign + particular services to custom networks. For details, refer to + @@ -94,9 +109,31 @@ Create the configuration file compose.yml. For details, ref +
+ Services definition + + Images can be pulled automatically + + &podman; checks if the image name declared in the compose.yml file is located + locally. If it is not, &podman; pulls the image from configured registries. + + + +
+
+ Networks definition + + By default, &compose; creates a default network and each + container in the application stack is included in the network. The default network does + not have to be declared in the compose.yml file as it is created + automatically by &compose;. + +
+
+ Example of <filename>compose.yml</filename> - For example, to define an application that uses the Prometheus monitoring system and the - Grafana analytics system, create a compose.yml similar to the following. + The following example of compose.yml defines an application stack that uses the Prometheus monitoring system and the + Grafana analytics system. services: @@ -137,13 +174,8 @@ volumes: │   └── prometheus.yml └── README.md - - Images can be pulled automatically - -&podman; checks if the image name declared in the compose.yml file is located -locally. If it is not, &podman; pulls the image from configured registries. - - +
+
Deploying applications From 8720a27283085de543ee1f80d433963d6fff4121 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Tue, 5 Mar 2024 15:33:32 +0100 Subject: [PATCH 13/23] Added networks. --- references/docker-compose-yaml-reference.xml | 29 +++++ tasks/docker-compose-creating-application.xml | 120 +----------------- 2 files changed, 31 insertions(+), 118 deletions(-) diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index 47b0a923c..885b20f06 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -93,6 +93,35 @@ not have to be declared in the compose.yml file as it is created automatically by &compose;. + + You can also define custom networks and assign particular services to them. For + example, to create two networks network1 and + network2, add the following snippet: + + +networks: + network1: + # Use a custom driver + driver: custom-driver-1 + network2: + # Use a custom driver and name the network + driver: custom-driver-2 + name: custom_network + + + You can also use already existing network. In this case, mark the network as external: + + + networks: + network1: + name: network1 + external: true + + + For a complete networks specification, refer to &compose; + specification. +
Example of <filename>compose.yml</filename> diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index 67a2ca751..929abffdf 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -61,123 +61,7 @@ Create the configuration file compose.yml. For details, ref -
- Creating <filename>compose.yml</filename> - - To create the application, you need to create a YAML file that defines your application. The - compose.yml file should include the following parts. - - - - service - - - A service is a computing component of the application. It is a run of a container image - with a particular configuration. - - - When defining services you either need to specify a container image to use by adding image, or use the - build statement and provide a container file to build the service from - source files. - - - - - networks - - - You can use the network statement to define custom networks and assign - particular services to custom networks. For details, refer to - - - - - - Volume - - - A directory where services store and shares data. - - - - - Environment variables - - - You may also need to use a list of environment variables that will be passed to your services. - - - - -
- Services definition - - Images can be pulled automatically - - &podman; checks if the image name declared in the compose.yml file is located - locally. If it is not, &podman; pulls the image from configured registries. - - - -
-
- Networks definition - - By default, &compose; creates a default network and each - container in the application stack is included in the network. The default network does - not have to be declared in the compose.yml file as it is created - automatically by &compose;. - -
-
- Example of <filename>compose.yml</filename> - - The following example of compose.yml defines an application stack that uses the Prometheus monitoring system and the - Grafana analytics system. - - - services: - prometheus: - image: prom/prometheus - container_name: prometheus - command: - - '--config.file=/etc/prometheus/prometheus.yml' - ports: - - 9090:9090 - restart: unless-stopped - volumes: - - ./prometheus:/etc/prometheus - - prom_data:/prometheus - grafana: - image: grafana/grafana - container_name: grafana - ports: - - 3000:3000 - restart: unless-stopped - environment: - - GF_SECURITY_ADMIN_USER=admin - - GF_SECURITY_ADMIN_PASSWORD=grafana - volumes: - - ./grafana:/etc/grafana/provisioning/datasources -volumes: - prom_data: - - - The project structure in this example must look as follows: - - -. -├── compose.yaml -├── grafana -│   └── datasource.yml -├── prometheus -│   └── prometheus.yml -└── README.md - -
- -
-
+
Deploying applications After you create the proper directory structure and the compose.yml @@ -200,7 +84,7 @@ volumes: is located: &prompt.user;podman compose up -d -&compose; creates a separata network for te application stack. +&compose; creates a separate network for te application stack. From 2efc14549125c03be78e3cefe5632527b1dd8651 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Wed, 6 Mar 2024 16:49:17 +0100 Subject: [PATCH 14/23] Restructured. --- articles/docker-compose.asm.xml | 94 +++++++++---------- concepts/docker-compose-about.xml | 3 + concepts/docker-compose-management.xml | 42 +++++++++ concepts/docker-compose-podman-docker.xml | 6 +- concepts/docker-compose-tools.xml | 36 +++++++ references/docker-compose-yaml-reference.xml | 87 +++++++++++++---- tasks/docker-compose-create-application.xml | 77 --------------- tasks/docker-compose-creating-application.xml | 52 +--------- .../docker-compose-deploying-application.xml | 70 ++++++++++++++ 9 files changed, 271 insertions(+), 196 deletions(-) create mode 100644 concepts/docker-compose-management.xml create mode 100644 concepts/docker-compose-tools.xml delete mode 100644 tasks/docker-compose-create-application.xml create mode 100644 tasks/docker-compose-deploying-application.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index d5e065b6c..83e436276 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -29,8 +29,11 @@ Glue what's next - + docker-compose-tools + + Intro to tools + About podman-docker @@ -47,8 +50,8 @@ Installing podman-docker - - Creating a container-based application + + Deploying a container-based application Installing podman-docker @@ -57,13 +60,13 @@ Creating containerized applications - Creating containerized applications + Installing &compose; - - Reference example + + compose.yml @@ -83,31 +86,12 @@ - 2054-11-14 + 2024-03-14 - Added sections: - - - - New section on foo to resolve issue bsc#12345 - - New section on foo bar - - - Removed sections: - - Removed section on foo1 to resolve issue bsc#12346 - Removed section on foo1 bar - - - Changed sections: - - Changed section on foo2 to resolve issue bsc#12347 - Changed section on foo2 bar - - + Initial version + @@ -140,9 +124,10 @@ &productname; - short title for SEO and social media, max. 55 chars - short description, max. 150 chars - ultrashort description for social media, max 55 chars + Docker-compose application stack + Overview of docker-compose and its role in + creating container-based application steacks. + Creating a container-based application stack. @@ -161,7 +146,9 @@ WHAT? - You want to create a container-based application using &compose;. + &compose; enables you to define and manage a multi-container application stack. The + tool simplifies the deployment of such an application stack by using an easy-to-use + definition file. @@ -169,7 +156,7 @@ WHY? - State the reason why one should read this. + The article describes how to create a container-based application stack by using &compose;. @@ -185,26 +172,17 @@ GOAL - What's the reader's take-away from this article? + You will be able to create your own container-based application stack. REQUIREMENTS - - - - - The application architecture. - - - - + + Container images or its source files that are used to form the application. - - - + @@ -212,6 +190,12 @@ + + + + + + @@ -255,14 +239,30 @@ + + + + + + + + + + + + + + + + - + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 0aa15170a..923b8178f 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -33,9 +33,12 @@ between environments. Using &compose; you can recreate only those containers that have changed without destroyng the whole application stack. + + <command>docker</command> replaced with the <command>podman</command> command On &productnameshort; the podman-docker script is used to call &podman; whenever you run &compose;, as &docker; is not present on &productnameshort;. + diff --git a/concepts/docker-compose-management.xml b/concepts/docker-compose-management.xml new file mode 100644 index 000000000..568cc27cb --- /dev/null +++ b/concepts/docker-compose-management.xml @@ -0,0 +1,42 @@ + + + + + %entities; +]> + + + + + + + Management of a container-base application stack + + + + + The topic covers exiting application stacks, viewing their status and so on. + + + + + After you create your application stack, you may need to view the status of containers included + in the application stack. + + +
+ Exiting and removing the application stack + + To exit and remove the whole application stack including its network, run the command: + + &prompt.user;docker compose down +
+
diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml index 0f35c98b7..65dc7ba35 100644 --- a/concepts/docker-compose-podman-docker.xml +++ b/concepts/docker-compose-podman-docker.xml @@ -27,11 +27,7 @@ - - As &productnameshort; uses &podman; to manage containers, you may face a problem if your - scripts use &docker;. To avoid changing your &docker; scripts, you can use - podman-docker. - + podman-docker is a bash script that changes any docker command you run into a corresponding podman command with the same passed diff --git a/concepts/docker-compose-tools.xml b/concepts/docker-compose-tools.xml new file mode 100644 index 000000000..824543c8a --- /dev/null +++ b/concepts/docker-compose-tools.xml @@ -0,0 +1,36 @@ + + + + + %entities; +]> + + + + + + + Tools involved in management of container-based application stacks + + + + + Introductory text + + + + + &compose; is the tool responsible for creating the application stack. However, as it by default + uses &docker;, which is not present on &productnameshort;, the podman-docker + script is used to bypass &docker; and use &podman; instead. Therefore, you do not need to + change your already existing scripts from using &docker; to &podman;. + + diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index 885b20f06..a951f5532 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -10,7 +10,7 @@ - To create the application, you need to create a compose.yml file that defines your application. The - file should include the following parts. + file can include the following parts. - service + service A service is a computing component of the application. It is a run of a container image with a particular configuration. For details regarding the definition, refer to - - + - networks + networks You can use the network statement to define custom networks and assign @@ -53,7 +52,7 @@ - Volume + volumes A directory where services store and shares data. @@ -64,25 +63,73 @@ Environment variables - You may also need to use a list of environment variables that will be passed to your services. + You may also need to use a list of environment variables that will be passed to your + services. For details, refer to the environment variables + reference. + + configs + + + All configuration files services require must be declared in the + configs sections. For details, refer to the configs + definition. + + +
Services definition - When defining services you either need to specify a container image to use by adding image, or use the - build statement and provide a container file to build the service from - source files. + When defining services you either need to specify a container image to use, or provide source + files to build the service from them. - - Images can be pulled automatically - - &podman; checks if the image name declared in the compose.yml file is located - locally. If it is not, &podman; pulls the image from configured registries. - - + + To create the service container from an image, use the image statement: + + + services: + db: + image: database + + + &podman; checks if the image name declared in the compose.yml file is located + locally. If it is not, &podman; pulls the image from configured registries. + + + To build a service from source files, provide the source files and create a container file. + In the compose.ymlfile then use the build statement: + + + services: + db: + build: PATH_TO_SOURCE_FILES + + + If a particular service must be started after another, you can use the + depends_on statement: + + + services: + db: + image: database + depends_on: + system: + condition: SERVICE_CONDITION + + + The SERVICE_CONDITION can be one of the following: + service_started, service_healthy or service_completed_successfully + + + For more information regarding services definition, refer to the services specification. + +
@@ -109,7 +156,7 @@ networks: name: custom_network - You can also use already existing network. In this case, mark the network as external: + You can also use an already existing network. In this case, mark the network as external: networks: @@ -119,7 +166,7 @@ networks: For a complete networks specification, refer to &compose; + xlink:href="https://docs.docker.com/compose/compose-file/06-networks/">networks> specification.
diff --git a/tasks/docker-compose-create-application.xml b/tasks/docker-compose-create-application.xml deleted file mode 100644 index 620c6b580..000000000 --- a/tasks/docker-compose-create-application.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - %entities; -]> - - - - - - - Creating a containers-based application. - - - - - By using &compose; you can create and start a container-based application. - - - - - The procedure of creating and starting a container-based application can be summarized into the following steps: - - - - -Prepare the compose.yml file. - - - - - Optionally, prepare the environment variables file. - - - - - Use &compose; to start the application. - - - -
- Preparing the <filename>compose.yml</filename> file - - - - For a complete specification, refer to the &compose; file specification. - -
- -
- Starting the application - - In the directory, where compose.yml reside, run: - - &prompt.root;compose up [OPTIONS] - [SERVICE] - - The recommended option is as it starts the containers in detached state. - Otherwise, the containers exit as soon as the command is terminated. - - -
-
diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index 929abffdf..f9d0a3c4a 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Creating a container-based application @@ -29,12 +29,12 @@ in the assembly --> - To create a containerized application, proceed as follows: + To create a containerized applications stack, proceed as follows: -Create the configuration file compose.yml. For details, refer to . +Create the configuration file compose.yml. For details, refer to . @@ -57,50 +57,8 @@ Create the configuration file compose.yml. For details, ref - Deploy the application. For details, refer to . + Deploy the application. For details, refer to . -
- Deploying applications - - After you create the proper directory structure and the compose.yml - file, you can deploy the application: - - - - - Verify that there is no running copy of the container you intend to run: - - &prompt.user; podman ps - - If needed, remove the particular container: - - &prompt.user; podman rm -f CONTAINER_ID - - - - Start the application stack by running from the directory where compose.yml - is located: - &prompt.user;podman compose up -d - -&compose; creates a separate network for te application stack. - - - - - You can verify that containers are running and ports are mapped by listing running containers: - - &prompt.user;podman ps - - - - Exiting the application stack - -To exit the application stack, run the command: - - &prompt.user;docker compose down - - -
- + diff --git a/tasks/docker-compose-deploying-application.xml b/tasks/docker-compose-deploying-application.xml new file mode 100644 index 000000000..9e733f903 --- /dev/null +++ b/tasks/docker-compose-deploying-application.xml @@ -0,0 +1,70 @@ + + + + + %entities; +]> + + + + + + + Deploying applications + + + + + The topic covers the command that deploys the &compose; application. + + + + + After you create the proper directory structure and the compose.yml + file, you can deploy the application: + + + + + Verify that there is no running copy of the container you intend to run: + + &prompt.user; podman ps + + If needed, remove the particular container: + + &prompt.user; podman rm -f CONTAINER_ID + + + + Start the application stack by running from the directory where compose.yml + is located: + &prompt.user;podman compose up -d + +&compose; creates a separate network for te application stack. + + + + + You can verify that containers are running and ports are mapped by listing running containers: + + &prompt.user;podman ps + + + + Exiting the application stack + +To exit the application stack, run the command: + + &prompt.user;docker compose down + + + From 9b1b51873b2215b4be5f51772c110091d964ad86 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Thu, 7 Mar 2024 12:18:52 +0100 Subject: [PATCH 15/23] Completed the compose. --- articles/docker-compose.asm.xml | 12 ++- concepts/docker-compose-about.xml | 2 +- concepts/docker-compose-management.xml | 42 -------- concepts/docker-compose-tools.xml | 3 +- references/docker-compose-management.xml | 95 +++++++++++++++++++ .../docker-compose-deploying-application.xml | 10 +- 6 files changed, 110 insertions(+), 54 deletions(-) delete mode 100644 concepts/docker-compose-management.xml create mode 100644 references/docker-compose-management.xml diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 83e436276..3ae09957e 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -68,6 +68,9 @@ compose.yml + + Stack management + @@ -164,7 +167,7 @@ EFFORT - What's the effort one has to put in? + It takes approx. 20 minutes to read the article. @@ -262,6 +265,13 @@
+ + + + + + + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 923b8178f..aed1657a1 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Overview of &compose; + About &compose; diff --git a/concepts/docker-compose-management.xml b/concepts/docker-compose-management.xml deleted file mode 100644 index 568cc27cb..000000000 --- a/concepts/docker-compose-management.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - %entities; -]> - - - - - - - Management of a container-base application stack - - - - - The topic covers exiting application stacks, viewing their status and so on. - - - - - After you create your application stack, you may need to view the status of containers included - in the application stack. - - -
- Exiting and removing the application stack - - To exit and remove the whole application stack including its network, run the command: - - &prompt.user;docker compose down -
-
diff --git a/concepts/docker-compose-tools.xml b/concepts/docker-compose-tools.xml index 824543c8a..fef8d5893 100644 --- a/concepts/docker-compose-tools.xml +++ b/concepts/docker-compose-tools.xml @@ -31,6 +31,7 @@ &compose; is the tool responsible for creating the application stack. However, as it by default uses &docker;, which is not present on &productnameshort;, the podman-docker script is used to bypass &docker; and use &podman; instead. Therefore, you do not need to - change your already existing scripts from using &docker; to &podman;. + change your already existing scripts from using &docker; to &podman;. The tools are in more + detail described in following sections. diff --git a/references/docker-compose-management.xml b/references/docker-compose-management.xml new file mode 100644 index 000000000..7ae942a75 --- /dev/null +++ b/references/docker-compose-management.xml @@ -0,0 +1,95 @@ + + + + + %entities; +]> + + + + + + + Management of a container-base application stack + + + + + The topic covers exiting application stacks, viewing their status and other admnistrating task. + + + + + After you create your application stack, you can use the docker-compose + command to perform management operations. The command syntax is the following: + + &prompt.user;docker compose [OPTIONS] + COMMAND + + Run the command from the same directory, where is the + compose.yml file of the application stack you want to manage. + Alternatively, provide a path to the compose.yml file using the + option. For example, to exit and remove the application stack: + + &prompt.user;docker compose -f ./test/compose.yml down + + Other useful commands: + + + + images + + +To list all images used by the containers in the application stack. + + &prompt.user;docker compose images + + + + pause + + + To pause all containers. + + &prompt.user;docker compose pause [SERVICE] + + + + ps + + + To list containers in the application stack. + + &prompt.user;docker compose ps + + + + rm + + To remove stopped containers. + &prompt.user;docker compose rm + + + + start/stop + + + To start or stop containers. + + &prompt.user;docker compose stop [SERVICE] + + + + +For a complete list of options and command, run: + +&prompt.user;docker-compose --help + diff --git a/tasks/docker-compose-deploying-application.xml b/tasks/docker-compose-deploying-application.xml index 9e733f903..1e5b7f92b 100644 --- a/tasks/docker-compose-deploying-application.xml +++ b/tasks/docker-compose-deploying-application.xml @@ -59,12 +59,4 @@ in the assembly --> &prompt.user;podman ps
- - Exiting the application stack - -To exit the application stack, run the command: - - &prompt.user;docker compose down - - - + From 9023b654f752be329782d8518df3ef412f9b8eba Mon Sep 17 00:00:00 2001 From: lvicoun Date: Fri, 15 Mar 2024 10:52:21 +0100 Subject: [PATCH 16/23] Apply suggestions from code review Co-authored-by: Daria Vladykina Co-authored-by: Danish Prakash --- articles/docker-compose.asm.xml | 8 ++++---- concepts/docker-compose-about.xml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 3ae09957e..11aa1c4d9 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -84,7 +84,7 @@ - Managing multi-container applications using <literal>&compose;</literal> + Managing Multi-Container Applications Using <literal>&compose;</literal> @@ -129,8 +129,8 @@ Docker-compose application stack Overview of docker-compose and its role in - creating container-based application steacks. - Creating a container-based application stack. + creating container-based application stacks + Creating a container-based application stack @@ -183,7 +183,7 @@ REQUIREMENTS - Container images or its source files that are used to form the application. + Application container images or the associated source files that are used to build the application. diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index aed1657a1..156ec1439 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -23,15 +23,15 @@ - The topic describes basics of the &compose; tool. + The topic describes the basics of the &compose; tool. &compose; is a tool for managing multi-container applications. &compose; enables you to - have multiple isolated environment on a single host, while it supports using variables - between environments. Using &compose; you can recreate only those containers that have - changed without destroyng the whole application stack. + have multiple isolated environments on a single host, while it supports using variables + between environments. Using &compose;, you can recreate only those containers that have + changed without destroying the whole application stack. <command>docker</command> replaced with the <command>podman</command> command From 563bf7723146e6e8a8758e2dd627dfe02c93468b Mon Sep 17 00:00:00 2001 From: lvicoun Date: Fri, 15 Mar 2024 10:55:11 +0100 Subject: [PATCH 17/23] Apply suggestions from code review Co-authored-by: Daria Vladykina Co-authored-by: Danish Prakash --- concepts/docker-compose-about.xml | 2 +- concepts/docker-compose-podman-docker.xml | 4 ++-- concepts/docker-compose-tools.xml | 10 +++++----- concepts/podman-about.xml | 4 ++-- references/docker-compose-management.xml | 2 +- references/docker-compose-yaml-file.xml | 4 ++-- references/docker-compose-yaml-reference.xml | 14 +++++++------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 156ec1439..4539d1066 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -36,7 +36,7 @@ <command>docker</command> replaced with the <command>podman</command> command - On &productnameshort; the podman-docker script is used to call + On &productnameshort;, the podman-docker script is used to call &podman; whenever you run &compose;, as &docker; is not present on &productnameshort;. diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml index 65dc7ba35..58afa72d2 100644 --- a/concepts/docker-compose-podman-docker.xml +++ b/concepts/docker-compose-podman-docker.xml @@ -23,7 +23,7 @@ - The topic covers the purpose of the podmna-docker tool. + The topic covers the purpose of the podman-docker tool. @@ -31,6 +31,6 @@ podman-docker is a bash script that changes any docker command you run into a corresponding podman command with the same passed - arguments.Therefore, you can use all your &docker; scripts without any modifications. + arguments. Therefore, you can use all your &docker; scripts without any modifications. diff --git a/concepts/docker-compose-tools.xml b/concepts/docker-compose-tools.xml index fef8d5893..56369488b 100644 --- a/concepts/docker-compose-tools.xml +++ b/concepts/docker-compose-tools.xml @@ -28,10 +28,10 @@ - &compose; is the tool responsible for creating the application stack. However, as it by default - uses &docker;, which is not present on &productnameshort;, the podman-docker - script is used to bypass &docker; and use &podman; instead. Therefore, you do not need to - change your already existing scripts from using &docker; to &podman;. The tools are in more - detail described in following sections. + &compose; is the tool responsible for creating the application stack. By default, it + uses &docker;, which is not present on &productnameshort;. To bypass &docker; and + use &podman; instead, the podman-docker script is used. Therefore, + you do not need to change your existing scripts from using &docker; to &podman;. + The following sections provide detailed descriptions of the tools. diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index 0d8baf456..cb122218e 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -30,14 +30,14 @@ Podman is a short name for Pod Manager Tool. It is a daemonless container engine that enables you to run and deploy applications using containers - and container images. Podman provides a command line interface to manage + and container images. Podman provides a command-line interface to manage containers. As Podman does not have a daemon, it provides integration with systemd. This makes it possible to control containers via systemd units. You can create these units for existing containers as well as generate units that - can start containers if they do not exist in the system. Moreover, Podman + can start containers if they do not exist in the system. Podman can run systemd inside containers. diff --git a/references/docker-compose-management.xml b/references/docker-compose-management.xml index 7ae942a75..b76a9ac59 100644 --- a/references/docker-compose-management.xml +++ b/references/docker-compose-management.xml @@ -89,7 +89,7 @@ To list all images used by the containers in the application stack. -For a complete list of options and command, run: +For a complete list of options and commands, run: &prompt.user;docker-compose --help diff --git a/references/docker-compose-yaml-file.xml b/references/docker-compose-yaml-file.xml index 7c3a5ba53..346b58c95 100644 --- a/references/docker-compose-yaml-file.xml +++ b/references/docker-compose-yaml-file.xml @@ -36,7 +36,7 @@ Service definition Each service is defined as a container image to use and a set of runtime arguments. Start - the services definition by adding the services as the top level element to + the services definition by adding services as the top-level element to the compose.yml file. Other elements are described below: @@ -53,7 +53,7 @@ image - Define the container image to use to start the service. + Defines the container image to use for starting the service. diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index a951f5532..19c25c4a1 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -37,7 +37,7 @@ A service is a computing component of the application. It is a run of a container image - with a particular configuration. For details regarding the definition, refer to + with a particular configuration. For details regarding the definition, refer to . @@ -47,7 +47,7 @@ You can use the network statement to define custom networks and assign particular services to custom networks. For details, refer to - + . @@ -55,7 +55,7 @@ volumes - A directory where services store and shares data. + A directory managed by the container engine where services store and share data. @@ -74,8 +74,8 @@ configs - All configuration files services require must be declared in the - configs sections. For details, refer to the configs section. For details, refer to the configs definition. @@ -85,7 +85,7 @@
Services definition - When defining services you either need to specify a container image to use, or provide source + When defining services, you either need to specify a container image to use, or provide source files to build the service from them. @@ -101,7 +101,7 @@ locally. If it is not, &podman; pulls the image from configured registries. - To build a service from source files, provide the source files and create a container file. + To build a service from source files, provide the source files and create a container file, both in the same directory. In the compose.ymlfile then use the build statement: From 3be19e90f9c6b95a1803fad99dfdf2b9b88573d3 Mon Sep 17 00:00:00 2001 From: lvicoun Date: Fri, 15 Mar 2024 11:02:05 +0100 Subject: [PATCH 18/23] Apply suggestions from code review Co-authored-by: Daria Vladykina Co-authored-by: Danish Prakash --- references/docker-compose-yaml-reference.xml | 18 +++++++++--------- tasks/docker-compose-creating-application.xml | 8 ++++---- tasks/docker-compose-deploying-application.xml | 10 +++++----- tasks/docker-compose-installing-compose.xml | 6 +++--- ...cker-compose-podman-docker-installation.xml | 4 ++-- tasks/podman-installation.xml | 6 +++--- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index 19c25c4a1..ff4c6c495 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -123,10 +123,10 @@ The SERVICE_CONDITION can be one of the following: - service_started, service_healthy or service_completed_successfully + service_started, service_healthy or service_completed_successfully. - For more information regarding services definition, refer to the services definition, refer to the services specification. @@ -135,14 +135,14 @@
Networks definition - By default, &compose; creates a default network and each + By default, &compose; creates a default network, and each container in the application stack is included in the network. The default network does - not have to be declared in the compose.yml file as it is created - automatically by &compose;. + not have to be declared in the compose.yml file as &compose; + creates it automatically. You can also define custom networks and assign particular services to them. For - example, to create two networks network1 and + example, to create two networks, network1 and network2, add the following snippet: @@ -156,7 +156,7 @@ networks: name: custom_network - You can also use an already existing network. In this case, mark the network as external: + You can also use an existing network. In this case, mark the network as external: networks: @@ -165,8 +165,8 @@ networks: external: true - For a complete networks specification, refer to networks> + For a complete networks specification, refer to the networks specification.
diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index f9d0a3c4a..fcfc15f67 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Creating a container-based applications stack @@ -29,7 +29,7 @@ in the assembly --> - To create a containerized applications stack, proceed as follows: + To create a containerized application stack, proceed as follows: @@ -39,8 +39,8 @@ Create the configuration file compose.yml. For details, ref - Prepare the required directory structure. We recommend that the - compose.yml file is located at the top of your working directory. + Prepare the required directory structure. We recommend placing the + compose.yml file at the top of your working directory. diff --git a/tasks/docker-compose-deploying-application.xml b/tasks/docker-compose-deploying-application.xml index 1e5b7f92b..cd8295a00 100644 --- a/tasks/docker-compose-deploying-application.xml +++ b/tasks/docker-compose-deploying-application.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Deploying applications @@ -35,13 +35,13 @@ in the assembly --> - Verify that there is no running copy of the container you intend to run: + Verify that the container you intend to run doesn't already exist: - &prompt.user; podman ps + &prompt.user;podman ps --all If needed, remove the particular container: - &prompt.user; podman rm -f CONTAINER_ID + &prompt.user;podman rm -f CONTAINER_ID @@ -49,7 +49,7 @@ in the assembly --> is located: &prompt.user;podman compose up -d -&compose; creates a separate network for te application stack. +&compose; creates a separate network for the application stack. diff --git a/tasks/docker-compose-installing-compose.xml b/tasks/docker-compose-installing-compose.xml index d6943e094..102e03d6d 100644 --- a/tasks/docker-compose-installing-compose.xml +++ b/tasks/docker-compose-installing-compose.xml @@ -24,12 +24,12 @@ in the assembly --> - The topic covers installation of &compose; on &productnameshort;. + The topic covers the installation of &compose; on &productnameshort;. - If &compose; is not pesent on your system, you can install it by following the steps: + If &compose; is not present on your system, you can install it by following the steps: @@ -37,7 +37,7 @@ in the assembly --> Run the command: -&prompt.sudo;transactional-update pkg install compose +&prompt.sudo;transactional-update pkg install docker-compose diff --git a/tasks/docker-compose-podman-docker-installation.xml b/tasks/docker-compose-podman-docker-installation.xml index dcb02ad21..4a987993c 100644 --- a/tasks/docker-compose-podman-docker-installation.xml +++ b/tasks/docker-compose-podman-docker-installation.xml @@ -24,12 +24,12 @@ in the assembly --> - The topic covers installation of podman-docker. + The topic covers the installation of podman-docker. The podman-docker is not installed on &productnameshort; by default. To - install it proceed as follows: + install it, proceed as follows: diff --git a/tasks/podman-installation.xml b/tasks/podman-installation.xml index c106b1857..2bee54ed8 100644 --- a/tasks/podman-installation.xml +++ b/tasks/podman-installation.xml @@ -24,13 +24,13 @@ in the assembly --> - The topic covers installation of &podman;. + The topic covers the installation of &podman;. - &podman; is on &productnameshort; present by default. However, if in any case &podman; is - missing, you can install it as described bellow: + &podman; is included in &productnameshort; by default. However, if &podman; is + missing, you can install it as described below: From 975e06ac9cb886a09f2d8fa335ff3fadf4d8e2a2 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 15 Mar 2024 12:44:50 +0100 Subject: [PATCH 19/23] Applied review. --- articles/docker-compose.asm.xml | 16 +++------------ concepts/docker-compose-about.xml | 2 +- concepts/docker-compose-tools.xml | 4 ++-- references/docker-compose-management.xml | 16 +++++++-------- references/docker-compose-yaml-file.xml | 7 ++++--- references/docker-compose-yaml-reference.xml | 20 ++++++++++++------- tasks/docker-compose-creating-application.xml | 19 +++++++++--------- .../docker-compose-deploying-application.xml | 8 ++++---- tasks/podman-installation.xml | 2 +- 9 files changed, 45 insertions(+), 49 deletions(-) diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 11aa1c4d9..7d6a48404 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -18,17 +18,7 @@ --> - - - Glue example - - - Glue for more information - - - Glue what's next - - + docker-compose-tools @@ -149,7 +139,7 @@ WHAT? - &compose; enables you to define and manage a multi-container application stack. The + &compose; enables you to define and manage a multi-container application. The tool simplifies the deployment of such an application stack by using an easy-to-use definition file. @@ -159,7 +149,7 @@ WHY? - The article describes how to create a container-based application stack by using &compose;. + The article describes how to create a multi-container application by using &compose;. diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index 4539d1066..a8e28af77 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -31,7 +31,7 @@ &compose; is a tool for managing multi-container applications. &compose; enables you to have multiple isolated environments on a single host, while it supports using variables between environments. Using &compose;, you can recreate only those containers that have - changed without destroying the whole application stack. + changed without destroying the whole multi-container application. <command>docker</command> replaced with the <command>podman</command> command diff --git a/concepts/docker-compose-tools.xml b/concepts/docker-compose-tools.xml index 56369488b..96476c0ed 100644 --- a/concepts/docker-compose-tools.xml +++ b/concepts/docker-compose-tools.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Tools involved in management of container-based application stacks + Tools involved in management of multi-container applications @@ -28,7 +28,7 @@ - &compose; is the tool responsible for creating the application stack. By default, it + &compose; is the tool responsible for creating the multi-container application. By default, it uses &docker;, which is not present on &productnameshort;. To bypass &docker; and use &podman; instead, the podman-docker script is used. Therefore, you do not need to change your existing scripts from using &docker; to &podman;. diff --git a/references/docker-compose-management.xml b/references/docker-compose-management.xml index b76a9ac59..c944486dc 100644 --- a/references/docker-compose-management.xml +++ b/references/docker-compose-management.xml @@ -18,26 +18,26 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Management of a container-base application stack + Management of a multi-container application - The topic covers exiting application stacks, viewing their status and other admnistrating task. + The topic covers exiting multi-container applications, viewing their status and other admnistrating task. - After you create your application stack, you can use the docker-compose + After you create your multi-container application, you can use the docker-compose command to perform management operations. The command syntax is the following: &prompt.user;docker compose [OPTIONS] COMMAND - Run the command from the same directory, where is the - compose.yml file of the application stack you want to manage. + Run the command from the same directory where the + compose.yml file of the multi-container application you want to manage is located. Alternatively, provide a path to the compose.yml file using the - option. For example, to exit and remove the application stack: + option. For example, to exit and remove the multi-container application: &prompt.user;docker compose -f ./test/compose.yml down @@ -48,7 +48,7 @@ images -To list all images used by the containers in the application stack. +To list all images used by the containers in the multi-container application. &prompt.user;docker compose images @@ -66,7 +66,7 @@ To list all images used by the containers in the application stack. ps - To list containers in the application stack. + To list containers in the multi-container application. &prompt.user;docker compose ps diff --git a/references/docker-compose-yaml-file.xml b/references/docker-compose-yaml-file.xml index 346b58c95..429f6ecec 100644 --- a/references/docker-compose-yaml-file.xml +++ b/references/docker-compose-yaml-file.xml @@ -28,9 +28,10 @@ - The compose.yml is preferably placed in the working directory. It can be - either a single file or you can use more granular approach by utilizing fragments and - extensions. Multiple &compose; files can be also merged together to define the whole application model. + The compose.yml file is preferably placed in + the working directory. It can be a single file, or you can use a more granular + approach by utilizing fragments and extensions. Multiple &compose; files + can be also merged to define the whole application model.
Service definition diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index ff4c6c495..0dda91232 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -23,21 +23,26 @@ - Introductory text + The topic describes parts of the compose.yml file. - To create the application, you need to create a compose.yml file that defines your application. The - file can include the following parts. + To create the multi-container application, you need to create a compose.yml file preferably placed in + the working directory. It can be a single file, or you can use a more granular + approach by utilizing fragments and extensions. Multiple &compose; files + can be also merged to define the whole application model. + + + The file compose.yml defines your application. You can + include the following parts. service - A service is a computing component of the application. It is a run of a container image - with a particular configuration. For details regarding the definition, refer to . + A service is a computing component of the application. For details regarding the definition, refer to . @@ -97,8 +102,9 @@ image: database - &podman; checks if the image name declared in the compose.yml file is located - locally. If it is not, &podman; pulls the image from configured registries. + &podman; checks if the image name declared in the compose.yml file is + available in the local container storage. If it is not, &podman; pulls the image from one + of the configured registries. To build a service from source files, provide the source files and create a container file, both in the same directory. diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index fcfc15f67..9e80cdcc0 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -18,18 +18,18 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Creating a container-based application stack - The topic covers a simple example of a containerized application. + The topic covers a simple example of a multi-container application. - To create a containerized application stack, proceed as follows: + To create a multi-container application, proceed as follows: @@ -46,18 +46,17 @@ Create the configuration file compose.yml. For details, ref - If needed, prepare files specific to services used by the containerized application. For - exammple, if you intend to build your own service, create a containerfile. - Alternatively, include configuration files of the services being used. + If needed, write your own container files specific to services used by the containerized application. For + exammple, to deploy a Go application, create a container file for the Go application with + the required configuration and dependencies. - We - recommend to create a subdirectory per service in the working directory and place the - service-specific files there. + We recommend creating a subdirectory per service in the working + directory and placing the service-specific files there. - Deploy the application. For details, refer to . + Deploy the multi-container application. For details, refer to . diff --git a/tasks/docker-compose-deploying-application.xml b/tasks/docker-compose-deploying-application.xml index cd8295a00..89c1c7a93 100644 --- a/tasks/docker-compose-deploying-application.xml +++ b/tasks/docker-compose-deploying-application.xml @@ -18,7 +18,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Deploying applications @@ -30,7 +30,7 @@ in the assembly --> After you create the proper directory structure and the compose.yml - file, you can deploy the application: + file, you can deploy the multi-container application: @@ -45,11 +45,11 @@ in the assembly --> - Start the application stack by running from the directory where compose.yml + Start the multi-container application by running the following command from the directory where compose.yml is located: &prompt.user;podman compose up -d -&compose; creates a separate network for the application stack. +&compose; creates a separate network for the multi-container application. diff --git a/tasks/podman-installation.xml b/tasks/podman-installation.xml index 2bee54ed8..e8c34bfb8 100644 --- a/tasks/podman-installation.xml +++ b/tasks/podman-installation.xml @@ -37,7 +37,7 @@ in the assembly --> Run the command: - &prompt.root;transactional-update pkg install podman* + &prompt.sudo;transactional-update pkg install podman* From f84e4581dff97f0140af7760f290550f7f158b82 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 15 Mar 2024 12:46:19 +0100 Subject: [PATCH 20/23] Removed a file. --- references/docker-compose-yaml-file.xml | 71 ------------------------- 1 file changed, 71 deletions(-) delete mode 100644 references/docker-compose-yaml-file.xml diff --git a/references/docker-compose-yaml-file.xml b/references/docker-compose-yaml-file.xml deleted file mode 100644 index 429f6ecec..000000000 --- a/references/docker-compose-yaml-file.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - %entities; -]> - - - - - - - The <filename>compose.yml</filename> file - - - - - Introductory text - - - - - The compose.yml file is preferably placed in - the working directory. It can be a single file, or you can use a more granular - approach by utilizing fragments and extensions. Multiple &compose; files - can be also merged to define the whole application model. - -
- Service definition - - Each service is defined as a container image to use and a set of runtime arguments. Start - the services definition by adding services as the top-level element to - the compose.yml file. Other elements are described below: - - - Service definition elements/title> - <varlistentry> - <term><literal>build</literal></term> - <listitem> - <para> - Specifies how to create a container image that is later used to start the service. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term><literal>image</literal></term> - <listitem> - <para> - Defines the container image to use for starting the service. - </para> - </listitem> - </varlistentry> - </variablelist> - </section> - <section xml:id="compose-yaml-file-network-definition"> - <title>Networks definition - - -
-
-Volumes definition -
-
From e66bdd07fead1842fd8c4643a0b3849a94d0bda1 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 15 Mar 2024 14:19:51 +0100 Subject: [PATCH 21/23] dockit pull changes. --- common/generic-entities.ent | 8 +++++++- doc-kit.conf | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/generic-entities.ent b/common/generic-entities.ent index 8cbf05fc5..31b00eb62 100644 --- a/common/generic-entities.ent +++ b/common/generic-entities.ent @@ -93,6 +93,7 @@ + @@ -339,6 +340,10 @@ use &deng;! --> + + + + @@ -360,7 +365,7 @@ use &deng;! --> - + @@ -519,6 +524,7 @@ use &deng;! --> + diff --git a/doc-kit.conf b/doc-kit.conf index 97a70752d..a3df9eb05 100644 --- a/doc-kit.conf +++ b/doc-kit.conf @@ -15,7 +15,7 @@ file: ccd4111fb11fe4fa272d565d22872dda991d48f7 templates/snippets/snippet_warni file: bc33a5462e82871906d98907a32d9e28d558dfaa templates/tasks/task.xml file: a694cf48c672db931339d607ce4176eee29682dc templates/topicmaps/example.xmind file: 093bd16b3acee829087711e1fdfd7d2bb8e2001c templates/topicmaps/example.png -file: b68e8cf0d6fb671578684779ef7a9b5cdbe79641 common/generic-entities.ent +file: aefb23ce881214b2cd25d1b9d947e077f0e99dbc common/generic-entities.ent file: a79a3bc929478668955564bab48aecc8502555f6 common/network-entities.ent file: 88bbd2edf1ecc4e5098a443a53e1560625cbeabe common/legal.xml file: 092bac4c1160db059d3054774b8271663503f0d0 common/license_gfdl1.2.xml From 11ae1baed11384f68da59754a15cb93d73bef015 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 15 Mar 2024 14:51:03 +0100 Subject: [PATCH 22/23] xmlformat. --- articles/docker-compose.asm.xml | 203 +++++++++--------- concepts/docker-compose-about.xml | 31 +-- concepts/docker-compose-podman-docker.xml | 16 +- concepts/docker-compose-tools.xml | 19 +- concepts/podman-about.xml | 19 +- references/docker-compose-management.xml | 52 +++-- references/docker-compose-yaml-reference.xml | 159 ++++++++------ tasks/docker-compose-creating-application.xml | 34 +-- .../docker-compose-deploying-application.xml | 76 ++++--- tasks/docker-compose-installing-compose.xml | 28 +-- ...ker-compose-podman-docker-installation.xml | 18 +- tasks/podman-installation.xml | 16 +- 12 files changed, 365 insertions(+), 306 deletions(-) diff --git a/articles/docker-compose.asm.xml b/articles/docker-compose.asm.xml index 7d6a48404..a23541b13 100644 --- a/articles/docker-compose.asm.xml +++ b/articles/docker-compose.asm.xml @@ -18,14 +18,14 @@ --> - docker-compose-tools Intro to tools - About podman-docker + About podman-docker + About &compose; @@ -33,7 +33,6 @@ About &podman; - @@ -52,7 +51,7 @@ Installing &compose; - + @@ -75,7 +74,6 @@ Managing Multi-Container Applications Using <literal>&compose;</literal> - @@ -83,8 +81,11 @@ - Initial version - + + + Initial version + + @@ -96,10 +97,10 @@ + see https://confluence.suse.com/x/aQDWNg + --> &productname; @@ -130,52 +131,55 @@ Documentation jsindelarova@suse.com - + yes - - - WHAT? - - - &compose; enables you to define and manage a multi-container application. The - tool simplifies the deployment of such an application stack by using an easy-to-use - definition file. - - - - - WHY? - - - The article describes how to create a multi-container application by using &compose;. - - - - - EFFORT + + + WHAT? + + + &compose; enables you to define and manage a multi-container + application. The tool simplifies the deployment of such an + application stack by using an easy-to-use definition file. + + + + + WHY? + + + The article describes how to create a multi-container + application by using &compose;. + + + + + EFFORT It takes approx. 20 minutes to read the article. - - - GOAL + + + GOAL - You will be able to create your own container-based application stack. + You will be able to create your own container-based application + stack. + + + + + REQUIREMENTS + + + Application container images or the associated source files + that are used to build the application. - - - REQUIREMENTS - - - Application container images or the associated source files that are used to build the application. - - @@ -189,81 +193,78 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/concepts/docker-compose-about.xml b/concepts/docker-compose-about.xml index a8e28af77..6c273d3d2 100644 --- a/concepts/docker-compose-about.xml +++ b/concepts/docker-compose-about.xml @@ -18,27 +18,30 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - About &compose; + About &compose; + - + + - The topic describes the basics of the &compose; tool. + The topic describes the basics of the &compose; tool. - - &compose; is a tool for managing multi-container applications. &compose; enables you to - have multiple isolated environments on a single host, while it supports using variables - between environments. Using &compose;, you can recreate only those containers that have - changed without destroying the whole multi-container application. - - - <command>docker</command> replaced with the <command>podman</command> command + + &compose; is a tool for managing multi-container applications. &compose; + enables you to have multiple isolated environments on a single host, while + it supports using variables between environments. Using &compose;, you can + recreate only those containers that have changed without destroying the + whole multi-container application. + + + <command>docker</command> replaced with the <command>podman</command> command - On &productnameshort;, the podman-docker script is used to call - &podman; whenever you run &compose;, as &docker; is not present on &productnameshort;. + On &productnameshort;, the podman-docker script is + used to call &podman; whenever you run &compose;, as &docker; is not + present on &productnameshort;. - diff --git a/concepts/docker-compose-podman-docker.xml b/concepts/docker-compose-podman-docker.xml index 58afa72d2..52bd034ee 100644 --- a/concepts/docker-compose-podman-docker.xml +++ b/concepts/docker-compose-podman-docker.xml @@ -18,19 +18,21 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - About <literal>podman-docker</literal> + About <literal>podman-docker</literal> + - + + - The topic covers the purpose of the podman-docker tool. + The topic covers the purpose of the podman-docker tool. - - podman-docker is a bash script that changes any docker - command you run into a corresponding podman command with the same passed - arguments. Therefore, you can use all your &docker; scripts without any modifications. + podman-docker is a bash script that changes any + docker command you run into a corresponding + podman command with the same passed arguments. + Therefore, you can use all your &docker; scripts without any modifications. diff --git a/concepts/docker-compose-tools.xml b/concepts/docker-compose-tools.xml index 96476c0ed..151c8b971 100644 --- a/concepts/docker-compose-tools.xml +++ b/concepts/docker-compose-tools.xml @@ -18,20 +18,23 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Tools involved in management of multi-container applications + Tools involved in management of multi-container applications + - + + - Introductory text + Introductory text - &compose; is the tool responsible for creating the multi-container application. By default, it - uses &docker;, which is not present on &productnameshort;. To bypass &docker; and - use &podman; instead, the podman-docker script is used. Therefore, - you do not need to change your existing scripts from using &docker; to &podman;. - The following sections provide detailed descriptions of the tools. + &compose; is the tool responsible for creating the multi-container + application. By default, it uses &docker;, which is not present on + &productnameshort;. To bypass &docker; and use &podman; instead, the + podman-docker script is used. Therefore, you do not need + to change your existing scripts from using &docker; to &podman;. The + following sections provide detailed descriptions of the tools. diff --git a/concepts/podman-about.xml b/concepts/podman-about.xml index cb122218e..61ffa9bf4 100644 --- a/concepts/podman-about.xml +++ b/concepts/podman-about.xml @@ -18,33 +18,34 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - About &podman; + About &podman; + - + + - The topic covers an introduction to &podman;. + The topic covers an introduction to &podman;. Podman is a short name for Pod Manager Tool. It is a daemonless container - engine that enables you to run and deploy applications using containers - and container images. Podman provides a command-line interface to manage + engine that enables you to run and deploy applications using containers and + container images. Podman provides a command-line interface to manage containers. As Podman does not have a daemon, it provides integration with systemd. This makes it possible to control containers via systemd units. You can create these units for existing containers as well as generate units that - can start containers if they do not exist in the system. Podman - can run systemd inside containers. + can start containers if they do not exist in the system. Podman can run + systemd inside containers. Podman enables you to organize your containers into pods. Pods share the same network interface and resources. A typical use case for organizing a group of containers into a pod is a container that runs a database and a - container with a client that accesses the database. + container with a client that accesses the database. - diff --git a/references/docker-compose-management.xml b/references/docker-compose-management.xml index c944486dc..16dcc8770 100644 --- a/references/docker-compose-management.xml +++ b/references/docker-compose-management.xml @@ -18,28 +18,33 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Management of a multi-container application + Management of a multi-container application + - + + - The topic covers exiting multi-container applications, viewing their status and other admnistrating task. + The topic covers exiting multi-container applications, viewing their + status and other admnistrating task. - After you create your multi-container application, you can use the docker-compose - command to perform management operations. The command syntax is the following: + After you create your multi-container application, you can use the + docker-compose command to perform management operations. + The command syntax is the following: - &prompt.user;docker compose [OPTIONS] +&prompt.user;docker compose [OPTIONS] COMMAND - Run the command from the same directory where the - compose.yml file of the multi-container application you want to manage is located. - Alternatively, provide a path to the compose.yml file using the - option. For example, to exit and remove the multi-container application: + Run the command from the same directory where the + compose.yml file of the multi-container application + you want to manage is located. Alternatively, provide a path to the + compose.yml file using the + option. For example, to exit and remove the multi-container application: - &prompt.user;docker compose -f ./test/compose.yml down +&prompt.user;docker compose -f ./test/compose.yml down Other useful commands: @@ -48,9 +53,10 @@ images -To list all images used by the containers in the multi-container application. + To list all images used by the containers in the multi-container + application. - &prompt.user;docker compose images +&prompt.user;docker compose images @@ -59,7 +65,7 @@ To list all images used by the containers in the multi-container application. To pause all containers. - &prompt.user;docker compose pause [SERVICE] +&prompt.user;docker compose pause [SERVICE] @@ -68,14 +74,16 @@ To list all images used by the containers in the multi-container application. To list containers in the multi-container application. - &prompt.user;docker compose ps +&prompt.user;docker compose ps rm - To remove stopped containers. - &prompt.user;docker compose rm + + To remove stopped containers. + +&prompt.user;docker compose rm @@ -84,12 +92,12 @@ To list all images used by the containers in the multi-container application. To start or stop containers. - &prompt.user;docker compose stop [SERVICE] +&prompt.user;docker compose stop [SERVICE]
- -For a complete list of options and commands, run: - -&prompt.user;docker-compose --help + + For a complete list of options and commands, run: + +&prompt.user;docker-compose --help diff --git a/references/docker-compose-yaml-reference.xml b/references/docker-compose-yaml-reference.xml index 0dda91232..12845eb2d 100644 --- a/references/docker-compose-yaml-reference.xml +++ b/references/docker-compose-yaml-reference.xml @@ -18,40 +18,46 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Creating <filename>compose.yml</filename> + Creating <filename>compose.yml</filename> + - + + - The topic describes parts of the compose.yml file. + The topic describes parts of the compose.yml file. - To create the multi-container application, you need to create a compose.yml file preferably placed in - the working directory. It can be a single file, or you can use a more granular - approach by utilizing fragments and extensions. Multiple &compose; files - can be also merged to define the whole application model. - - - The file compose.yml defines your application. You can - include the following parts. - + To create the multi-container application, you need to create a + compose.yml file preferably placed in the working + directory. It can be a single file, or you can use a more granular approach + by utilizing fragments and extensions. Multiple &compose; files can be also + merged to define the whole application model. + + + The file compose.yml defines your application. You can + include the following parts. + service - A service is a computing component of the application. For details regarding the definition, refer to . - + A service is a computing component of the application. For details + regarding the definition, refer to + . + networks - - You can use the network statement to define custom networks and assign - particular services to custom networks. For details, refer to + + You can use the network statement to define custom + networks and assign particular services to custom networks. For + details, refer to . @@ -60,7 +66,8 @@ volumes - A directory managed by the container engine where services store and share data. + A directory managed by the container engine where services store and + share data. @@ -68,19 +75,21 @@ Environment variables - You may also need to use a list of environment variables that will be passed to your - services. For details, refer to the environment variables - reference. - + You may also need to use a list of environment variables that will be + passed to your services. For details, refer to the + environment + variables reference. + configs - All configuration files required by the services must be declared in the - configs section. For details, refer to the configs section. For details, refer to the + configs definition. @@ -90,27 +99,31 @@
Services definition - When defining services, you either need to specify a container image to use, or provide source - files to build the service from them. + When defining services, you either need to specify a container image to + use, or provide source files to build the service from them. - To create the service container from an image, use the image statement: + To create the service container from an image, use the + image statement: - + services: db: image: database - &podman; checks if the image name declared in the compose.yml file is - available in the local container storage. If it is not, &podman; pulls the image from one - of the configured registries. + &podman; checks if the image name declared in the + compose.yml file is available in the local container + storage. If it is not, &podman; pulls the image from one of the + configured registries. - To build a service from source files, provide the source files and create a container file, both in the same directory. - In the compose.ymlfile then use the build statement: + To build a service from source files, provide the source files and create + a container file, both in the same directory. In the + compose.ymlfile then use the + build statement: - + services: db: build: PATH_TO_SOURCE_FILES @@ -119,7 +132,7 @@ If a particular service must be started after another, you can use the depends_on statement: - + services: db: image: database @@ -128,30 +141,33 @@ condition: SERVICE_CONDITION - The SERVICE_CONDITION can be one of the following: - service_started, service_healthy or service_completed_successfully. + The SERVICE_CONDITION can be one of the + following: service_started, + service_healthy or + service_completed_successfully. - For more information regarding the services definition, refer to the services specification. + For more information regarding the services + definition, refer to the + services + specification. - -
Networks definition - By default, &compose; creates a default network, and each - container in the application stack is included in the network. The default network does - not have to be declared in the compose.yml file as &compose; - creates it automatically. - - - You can also define custom networks and assign particular services to them. For - example, to create two networks, network1 and - network2, add the following snippet: - - + By default, &compose; creates a default network, and each container in + the application stack is included in the network. The default network + does not have to be declared in the compose.yml file + as &compose; creates it automatically. + + + You can also define custom networks and assign particular services to + them. For example, to create two networks, network1 + and network2, add the following snippet: + + networks: network1: # Use a custom driver @@ -161,28 +177,31 @@ networks: driver: custom-driver-2 name: custom_network - - You can also use an existing network. In this case, mark the network as external: - - + + You can also use an existing network. In this case, mark the network as + external: + + networks: network1: name: network1 external: true - - For a complete networks specification, refer to the + For a complete networks specification, refer to the + networks - specification. - + specification. +
Example of <filename>compose.yml</filename> - - The following example of compose.yml defines an application stack that uses the Prometheus monitoring system and the - Grafana analytics system. - - + + The following example of compose.yml defines an + application stack that uses the Prometheus monitoring system and the + Grafana analytics system. + + services: prometheus: image: prom/prometheus @@ -209,10 +228,10 @@ networks: volumes: prom_data: - - The project structure in this example must look as follows: - - + + The project structure in this example must look as follows: + + . ├── compose.yaml ├── grafana diff --git a/tasks/docker-compose-creating-application.xml b/tasks/docker-compose-creating-application.xml index 9e80cdcc0..a6dce2394 100644 --- a/tasks/docker-compose-creating-application.xml +++ b/tasks/docker-compose-creating-application.xml @@ -18,14 +18,16 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Creating a multi-container application + Creating a multi-container application + - + + - The topic covers a simple example of a multi-container application. - + The topic covers a simple example of a multi-container application. + @@ -34,30 +36,34 @@ in the assembly --> -Create the configuration file compose.yml. For details, refer to . + Create the configuration file compose.yml. For + details, refer to . Prepare the required directory structure. We recommend placing the - compose.yml file at the top of your working directory. + compose.yml file at the top of your working + directory. - - If needed, write your own container files specific to services used by the containerized application. For - exammple, to deploy a Go application, create a container file for the Go application with - the required configuration and dependencies. + If needed, write your own container files specific to services used by + the containerized application. For exammple, to deploy a Go + application, create a container file for the Go application with the + required configuration and dependencies. - We recommend creating a subdirectory per service in the working + + We recommend creating a subdirectory per service in the working directory and placing the service-specific files there. - Deploy the multi-container application. For details, refer to . + Deploy the multi-container application. For details, refer to + . - + diff --git a/tasks/docker-compose-deploying-application.xml b/tasks/docker-compose-deploying-application.xml index 89c1c7a93..eb0149d87 100644 --- a/tasks/docker-compose-deploying-application.xml +++ b/tasks/docker-compose-deploying-application.xml @@ -18,45 +18,51 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Deploying multi-container applications + Deploying multi-container applications + - + + - The topic covers the command that deploys the &compose; application. + The topic covers the command that deploys the &compose; application. + + After you create the proper directory structure and the + compose.yml file, you can deploy the multi-container + application: + + + - After you create the proper directory structure and the compose.yml - file, you can deploy the multi-container application: - - - - - Verify that the container you intend to run doesn't already exist: - - &prompt.user;podman ps --all - - If needed, remove the particular container: - - &prompt.user;podman rm -f CONTAINER_ID - - - - Start the multi-container application by running the following command from the directory where compose.yml - is located: - &prompt.user;podman compose up -d - -&compose; creates a separate network for the multi-container application. - - - - - You can verify that containers are running and ports are mapped by listing running containers: - - &prompt.user;podman ps - - - + Verify that the container you intend to run doesn't already exist: + +&prompt.user;podman ps --all + + If needed, remove the particular container: + +&prompt.user;podman rm -f CONTAINER_ID + + + + Start the multi-container application by running the following command + from the directory where compose.yml is located: + +&prompt.user;podman compose up -d + + &compose; creates a separate network for the multi-container + application. + + + + + You can verify that containers are running and ports are mapped by + listing running containers: + +&prompt.user;podman ps + + + diff --git a/tasks/docker-compose-installing-compose.xml b/tasks/docker-compose-installing-compose.xml index 102e03d6d..458cc8d8c 100644 --- a/tasks/docker-compose-installing-compose.xml +++ b/tasks/docker-compose-installing-compose.xml @@ -18,32 +18,36 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Installing &compose; + Installing &compose; + - + + - The topic covers the installation of &compose; on &productnameshort;. + The topic covers the installation of &compose; on &productnameshort;. - If &compose; is not present on your system, you can install it by following the steps: + If &compose; is not present on your system, you can install it by following + the steps: Run the command: - + &prompt.sudo;transactional-update pkg install docker-compose - - - - After the installation is complete, reboot your system to boot into the new snapshot. - - + + + + After the installation is complete, reboot your system to boot into the + new snapshot. + + diff --git a/tasks/docker-compose-podman-docker-installation.xml b/tasks/docker-compose-podman-docker-installation.xml index 4a987993c..fe677eed6 100644 --- a/tasks/docker-compose-podman-docker-installation.xml +++ b/tasks/docker-compose-podman-docker-installation.xml @@ -18,24 +18,28 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Installation of <literal>podman-docker</literal> + Installation of <literal>podman-docker</literal> + - + + - The topic covers the installation of podman-docker. + The topic covers the installation of podman-docker. - The podman-docker is not installed on &productnameshort; by default. To - install it, proceed as follows: + + The podman-docker is not installed on &productnameshort; + by default. To install it, proceed as follows: + Install the package podman-docker by running: - transactional-update pkg install podman-docker +transactional-update pkg install podman-docker diff --git a/tasks/podman-installation.xml b/tasks/podman-installation.xml index e8c34bfb8..acf0889e3 100644 --- a/tasks/podman-installation.xml +++ b/tasks/podman-installation.xml @@ -18,26 +18,28 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:trans="http://docbook.org/ns/transclusion"> - Installation of &podman; + Installation of &podman; + - + + - The topic covers the installation of &podman;. + The topic covers the installation of &podman;. - &podman; is included in &productnameshort; by default. However, if &podman; is - missing, you can install it as described below: + &podman; is included in &productnameshort; by default. However, if &podman; + is missing, you can install it as described below: Run the command: - &prompt.sudo;transactional-update pkg install podman* +&prompt.sudo;transactional-update pkg install podman* From 040c7e0fa4554d14a5e76e0976085622526818b1 Mon Sep 17 00:00:00 2001 From: Jana Halackova Date: Fri, 15 Mar 2024 15:28:44 +0100 Subject: [PATCH 23/23] Renamed DC file. --- DC-SLE-Micro-compose => DC-Micro-compose | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename DC-SLE-Micro-compose => DC-Micro-compose (100%) diff --git a/DC-SLE-Micro-compose b/DC-Micro-compose similarity index 100% rename from DC-SLE-Micro-compose rename to DC-Micro-compose