Zusammenfassung der Ressource
podman
Anmerkungen:
- https://podman.io/
Podman is a daemonless, open source, Linux native tool designed to make it easy to find, run, build, share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. Podman provides a command line interface (CLI) familiar to anyone who has used the Docker Container Engine. Most users can simply alias Docker to Podman (alias docker=podman) without any problems. Similar to other common Container Engines (Docker, CRI-O, containerd), Podman relies on an OCI compliant Container Runtime (runc, crun, runv, etc) to interface with the operating system and create the running containers. This makes the running containers created by Podman nearly indistinguishable from those created by any other common container engine.
- Podman is a daemonless, open source, Linux native tool designed to make it easy to find, run, build,
share and deploy applications using Open Containers Initiative (OCI) Containers and Container Images.
- Fetching and run Container Images with Podman
- $ podman search rhel
- $ podman pull rhel
Anmerkungen:
- After you have found an image, you can use Podman to download it. When using the pull subcommand, Podman fetches the image and saves it locally for future use:
- $ podman run ubi7/ubi:7.7 echo "Hello!"
Anmerkungen:
- The following example starts a container from a Red HatEnterprise Linux image. It sets the entry point for this container to the echo "Hello world"command.
- $ podman run -d rhscl/httpd-24-rhel7:2.4-36.8
Anmerkungen:
- To start a container image as a background process, pass the -d option to the podman runcommand:
- $ podman inspect -l -f "{{.NetworkSettings.IPAddress}}"
- $ podman run --name mysql-custom -e MYSQL_USER=redhat -e MYSQL_PASSWORD=r3dh4t -d
rhmap47/mysql:5.5
Anmerkungen:
- The previous example starts a RHEL image container that prints the two environment variables provided as parameters. Another use case for environment variables is setting up credentials into a MySQL database server:
- $ podman run rhscl/httpd-24-rhel7:2.4-36.8 ls /tmp
Anmerkungen:
- The specified command must be executable inside the container image.
- $ podman restart my-httpd-containe
- Finding Images
- podman images
- podman history image:tag
- podman login <registryURL> -u username -p <password>
- podman pull registryURL/username/image:tag
- podman search searchString
- Building Images
- podman build -t image:tag -f Dockerfile2
- podman tag image:tag image:tag2
- podman rag image:tag registryURL/username/image:tag
- podman build -t image:tag
- podman push registryURL/username/image:tag
- Processes and resources
- podman ps --all
- podman attach container
- podman exec container <command>
- podman top container
- podman logs -tail container
- podman port container
Anmerkungen:
- list the port mappings from a container to localhost
- Container's Filesystem
- podman diff
container
- podman cp source target
- podman mount container
- podman umount container
- podman import tarball
- podman save -o <archiveFile> --format <docker-archive | oci-archive | oci-dir | docker-dir> image:tag
- podman load -i archiveFile
- Running containers on images
- podman run --rm -it --name <name> images:tag command
- podman commit <container> newimage:tag
Anmerkungen:
- create new image based on the current state of running container
- podman create --name <name> image:tag
Anmerkungen:
- create (but don't start) a container from an image
- podman run <option>
- -d
Anmerkungen:
- Run the container in the background
- -p 8080:3200
Anmerkungen:
- Expose container port 8080 as localhost:3200
- -v /var/lib/mysqldb:/var/lib/db
Anmerkungen:
- map the /var/lib/mysqldb directory on localhost to a volume named /var/lib/db inside the container
- podman start <container>
- podman restart <container>
- podman wait container1 [container2]
Anmerkungen:
- wait on one or more containers to stop
- podman stop <container>
- podman kill <container>
- podman rm -f <container>
- podman stats <container>
- podman inspect <container>
- podman rmi -f <image>
- podman exec <container-name> curl -s http://localhost:80/teste.hml