Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/build-site.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
docker run -u $(id -u) -v $PWD:/antora:Z --rm -t antora/antora:2.3.1 --cache-dir=./.cache/antora site.yml
podman run -u $(id -u) -v $PWD:/antora:Z --rm -t antora/antora:2.3.1 --cache-dir=./.cache/antora site.yml
5 changes: 3 additions & 2 deletions documentation/antora.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: containers-tutorial
title: Containers Tutorial
version: master
display_version: v1.0
version: podman
display_version: v1.5
prerelease: true
nav:
- modules/ROOT/nav.adoc

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion documentation/modules/ROOT/pages/buildah.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In a terminal window, start the container having `buildah` installed:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker run -it --device /dev/fuse:rw --security-opt seccomp=unconfined --security-opt apparmor=unconfined quay.io/buildah/stable:latest bash
podman run -it --device /dev/fuse:rw --security-opt seccomp=unconfined --security-opt apparmor=unconfined quay.io/buildah/stable:latest bash
----

== Creating a Container Image
Expand Down
18 changes: 9 additions & 9 deletions documentation/modules/ROOT/pages/env.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/hello")
public class HelloResource {
public class GreetingResource {

@ConfigProperty(name = "config")
Optional<String> config;
Expand Down Expand Up @@ -59,23 +59,23 @@ Rebuild our image to get the new version of the application:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker build -t my-image .
podman build -t my-image .
----

Remove your running container:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker rm -f my-container
podman rm -f my-container
----

And run the new one:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker run -d --name my-container -p 8080:8080 my-image
podman run -d --name my-container -p 8080:8080 my-image
----

Now let's call the application:
Expand Down Expand Up @@ -124,9 +124,9 @@ Let's rebuild our image, re-create the container and call it again:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker build -t my-image .
docker rm -f my-container
docker run -d --name my-container -p 8080:8080 my-image
podman build -t my-image .
podman rm -f my-container
podman run -d --name my-container -p 8080:8080 my-image
curl localhost:8080/hello
----

Expand All @@ -143,15 +143,15 @@ Finally, let's replace the variable's content. First we remove the container:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker rm -f my-container
podman rm -f my-container
----

And then we re-create it passing a new value for the environment variable:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker run -d --name my-container -p 8080:8080 -e config=container my-image
podman run -d --name my-container -p 8080:8080 -e config=container my-image
----

Then we call the application again:
Expand Down
20 changes: 15 additions & 5 deletions documentation/modules/ROOT/pages/imagemanagement.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ With the Containerfile that we created in the last step, let's build a container
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker build -t my-image .
podman build -t my-image .
----

You'll see an output like this:
Expand Down Expand Up @@ -51,7 +51,7 @@ To see your just created image, just run:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker image list
podman image list
----

You'll see at least these two outputs:
Expand All @@ -66,6 +66,16 @@ registry.access.redhat.com/ubi9/openjdk-21-runtime 1.18-4 80786be7434f

Your image is the `my-image` and the `registry.access.redhat.com/ubi9/openjdk-21` is the image used to build yours.

== Removing images

To remove your just created image:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
podman image rm my-image
----

== Exploring the Desktop interface

Let's take a look at image management in the Desktop interfaces.
Expand All @@ -91,7 +101,7 @@ The Podman or Docker CLI offer many ways to manage container images. You can fin
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker image -h
podman image -h
----

[.console-output]
Expand Down Expand Up @@ -135,7 +145,7 @@ Let's try to remove your just created image:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker image rm my-image
podman image rm my-image
----

Great! You're well on your way to becoming a Container Image expert :)
Great! You're well on your way to becoming a Container Image expert :)
10 changes: 8 additions & 2 deletions documentation/modules/ROOT/pages/inside.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To perform it in our running container, just execute this:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker exec -it my-container /bin/bash
podman exec -it my-container /bin/bash
----

Your terminal prompt should by now look like this:
Expand Down Expand Up @@ -44,14 +44,20 @@ We can also print the VM settings of this container:
java -XshowSettings:vm -version
----

See Maven's installed version:
Since you are not in your host machine, `mvn` cannot be found:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
mvn -v
----

[.console-output]
[source,bash,subs="+macros,+attributes"]
----
bash: mvn: command not found
----

And even check the OS version details:

[.console-input]
Expand Down
19 changes: 17 additions & 2 deletions documentation/modules/ROOT/pages/podman-desktop.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ image::podman-desktop-nginx.png[alt="Podman Desktop running nginx", align="cente

== Creating a Pod

Podman also allows you to create pods, which are groups of containers that share the same network and storage. This is useful for applications that require multiple containers to run together, such as a database and web server. To create a pod, click the *Play Kubernetes YAML* button in the *Pods* tab. This will bring up a dialog where you select the Kubernetes YAML, and apply it to either Podman or a Kubernetes cluster. For this example, we'll create a `podman-desktop-pod.yaml` file with the following content.
Podman also allows you to create pods, which are groups of containers that share the same network and storage. This is useful for applications that require multiple containers to run together, such as a database and web server.

Before creating the pod, make sure to pull another image:

* Repeat the steps above to *pull* another image from the registry: `postgres:latest`.

Create a new file named `podman-desktop-pod.yaml` with the following content:

[.console-input]
[source,bash,subs="+macros,+attributes"]
Expand All @@ -65,7 +71,16 @@ spec:
value: mysecretpassword
----

This YAML file will create a pod with two containers, one running nginx and the other running PostgreSQL. The YAML file can be applied to the Podman engine by clicking the *Play* button after selecting the file. This will create the pod and start the containers.

This YAML file will create a pod with two containers, one running nginx and the other running PostgreSQL:

1. Click on the *Play Kubernetes Yaml* button in the top right corner.

2. Click on the *file* button and select the previously created YAML file.

3. Click on the *Play* button to launch the pod.

4. Click on the *Done* button.

image::podman-desktop-pod-play.png[alt="Podman Desktop Pod Create", align="center"]

Expand Down
4 changes: 2 additions & 2 deletions documentation/modules/ROOT/pages/ports.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ First let's remove the container:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker rm -f my-container
podman rm -f my-container
----

[TIP]
Expand All @@ -43,7 +43,7 @@ Now we re-create the container, but exposing the port 8080:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker run -d --name my-container -p 8080:8080 my-image
podman run -d --name my-container -p 8080:8080 my-image
----

Let's try to reach the application again:
Expand Down
14 changes: 7 additions & 7 deletions documentation/modules/ROOT/pages/pushing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ If you have a Docker Hub account:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker tag my-image docker.io/myrepository/my-image
podman tag my-image docker.io/myrepository/my-image
----

If using Quay.io:

[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker tag my-image quay.io/myrepository/my-image
podman tag my-image quay.io/myrepository/my-image
----

IMPORTANT: Make sure to replace `myrepository` with the name of your own repository.
Expand All @@ -33,12 +33,12 @@ If you build your image already using the tag, you won't need to do this step be
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker build -t quay.io/myrepository/my-image .
podman build -t quay.io/myrepository/my-image .
----

====

If you now run `docker images` you'll see something like this:
If you now run `podman images` you'll see something like this:

[.console-output]
[source,text]
Expand All @@ -60,7 +60,7 @@ Quay.io::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker login quay.io
podman login quay.io
----
--
Docker Hub::
Expand All @@ -69,7 +69,7 @@ Docker Hub::
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker login
podman login
----
--
====
Expand All @@ -79,7 +79,7 @@ And finally you can push it, eg.:
[.console-input]
[source,bash,subs="+macros,+attributes"]
----
docker push quay.io/myrepository/my-image
podman push quay.io/myrepository/my-image
----

You should have an output like this:
Expand Down
Loading