{"id":18363435,"url":"https://github.com/stuttgart-things/install-configure-podman","last_synced_at":"2025-08-24T06:11:43.491Z","repository":{"id":191156471,"uuid":"610375844","full_name":"stuttgart-things/install-configure-podman","owner":"stuttgart-things","description":"installs and configures podman, buildah and skopeo on linux","archived":false,"fork":false,"pushed_at":"2025-01-01T20:33:55.000Z","size":63,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-15T19:38:32.160Z","etag":null,"topics":["containerization","linux","podman","skopeo"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stuttgart-things.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T16:42:19.000Z","updated_at":"2024-06-13T11:21:22.000Z","dependencies_parsed_at":"2024-05-06T06:23:13.110Z","dependency_job_id":"b4f20198-bcbc-4c0d-94b7-80068fd9a17f","html_url":"https://github.com/stuttgart-things/install-configure-podman","commit_stats":null,"previous_names":["stuttgart-things/install-configure-podman"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuttgart-things%2Finstall-configure-podman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuttgart-things%2Finstall-configure-podman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuttgart-things%2Finstall-configure-podman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuttgart-things%2Finstall-configure-podman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stuttgart-things","download_url":"https://codeload.github.com/stuttgart-things/install-configure-podman/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173850,"owners_count":21059595,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["containerization","linux","podman","skopeo"],"created_at":"2024-11-05T23:06:30.501Z","updated_at":"2025-04-10T06:49:40.524Z","avatar_url":"https://github.com/stuttgart-things.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"stuttgart-things/install-configure-podman\n=========================================\n\ninstalls and configures podman, buildah and skopeo on various linux os\n\n\u003cdetails\u003e\u003csummary\u003eVariables\u003c/summary\u003e\n\n* `install_tools` -  Set this on False if you don't want buildah and skopeo to be installed (default: true)\n* `buildah_version` - Set the wanted buildah version\n* `skopeo_version` -  Set the wanted skopeo version\n* `configure_docker_registry_mirror` -  Set this on true if you want docker registry mirrors to be created (default: false)\n* `ubuntu_version` -  If you don't use a different OS, set your Ubuntu version\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eROLE INSTALLATION\u003c/summary\u003e\n\ncopy and paste the following into your terminal:\n\n```bash\ncat \u003c\u003cEOF \u003e /tmp/requirements.yaml\nroles:\n- src: https://github.com/stuttgart-things/install-configure-podman.git\n  scm: git\n- src: https://github.com/stuttgart-things/install-requirements.git\n  scm: git\n\ncollections:\n- name: community.general\n  version: 8.6.0\n- name: containers.podman\n  version: 1.13.0\nEOF\n\nansible-galaxy install -r /tmp/requirements.yaml --force\nansible-galaxy collection install -r /tmp/requirements.yaml --force\n\nrm -rf /tmp/requirements.yaml\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE INVENTORY\u003c/summary\u003e\n\n```bash\ncat \u003c\u003cEOF \u003e inventory\n[appserver]\n1.2.3.4 ansible_user=sthings\nEOF\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE PLAYBOOK\u003c/summary\u003e\n\ncopy and paste the following (on any place of the filesystem of the ansible host) into your terminal:\n\n```yaml\ncat \u003c\u003cEOF \u003e install-configure-podman.yaml\n---\n- hosts: \"{{ target_host | default('all') }}\"\n  become: true\n  roles:\n    - role: install-configure-podman\nEOF \n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE EXECUTION\u003c/summary\u003e\n\n```bash\nansible-playbook -i inventory install-configure-podman.yaml -vv \n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE USE-CASES BUILDAH AND PODMAN\u003c/summary\u003e\n\n```bash\n# Check buildah version\nbuildah version\n```\n```bash\n# Pull Image\nbuildah pull alpine\n```\n```bash\n# Create Dockerfile\n# Podman and Buildah default to Containerfile and will fall back to Dockerfile.\ncat \u003c\u003cEOF \u003e Dockerfile\nFROM ubuntu:18.04\nRUN echo 'Hello, World!' \u003e /test.txt\nEOF\n```\n```bash\n# Build Image\nbuildah build -t hello-world -f ./Dockerfile .\n```\n```bash\n# Run Podman (--rm = delete container after running)\npodman run -it hello-world cat /test.txt\n```\n```bash\n# Show Container name and ID\npodman ps\n```\n```bash\n# Stop Container\npodman stop {container-name-or-id}\n```\n```bash\n# Copy file from local to container\nbuildah copy container-name ./example.sh /usr/bin\n```\n```bash\n# Configure Image to run commands\nbuildah config --cmd /usr/bin/example.sh container-name\n```\n```bash\n# Buildah unmount container\nbuildah config --cmd /usr/bin/example.sh container-name\n```\n```bash\n# Buildah commit image\n buildah commit container-name new-image-name\n```\n```bash\n# Show Image\nbuildah images\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE USE-CASES PODMAN PLAY KUBE\u003c/summary\u003e\n\nThe Podman Play Kube Option is not available for remote clients, including Mac and Windows (excluding WSL2) machines, yet.\n\nCurrently supported Kinds in Kubernetes:\n* `Pod`\n* `Deployment`\n* `PersistentVolumeClaim`\n* `ConfigMap`\n\n```yaml\n# Create Pod\ncat \u003c\u003cEOF \u003e example-pod.yaml\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: hello-world-pod-2\n  labels:\n    app: hello-world\nspec:\n  containers:\n  - name: hello-world-sh\n    image: busybox\n    command: ['sh', '-c', 'while true; do echo \"Hello World\"; sleep 2; done']\n  - name: hello-world-http\n    image: busybox\n    command: ['sh','-c', 'echo \"hello world\" \u003e index.html \u0026\u0026 /bin/httpd -p 9000 -f']\n    ports:\n    - containerPort: 9000\n      protocol: TCP\n\nEOF\n```\n\n### Service\n\n\u003cdetails\u003e\u003csummary\u003eSERVICE TO EXPOSE POD TO PUBLIC\u003c/summary\u003e\n\n```yaml\n# Create Service to expose pod to public\ncat \u003c\u003cEOF \u003e example-service.yaml\n---\nkind: Service\napiVersion: v1\nmetadata:\n  name: hello-world-svc\nspec:\n  type: NodePort           \n  ports:\n  - port: 80\n    targetPort: 9000\n  selector:\n    app: hello-world\n\nEOF\n```\n\u003c/details\u003e\n\n##\n\n```bash\n# Create pod\npodman play kube example-pod.yaml\n```\n```bash\n# Tear down pod\npodman play kube --down example-pod.yaml\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE USE-CASE PODMAN GENERATE KUBE\u003c/summary\u003e\n\n### GENERATE KUBE YAML\n\nNote: When using volumes and generating a Kubernetes YAML for an unprivileged and rootless podman container on an SELinux enabled system, one of the following options must be completed:\n* `Add the “privileged: true” option to the pod spec` \n* `Add type: spc_t under the securityContext seLinuxOptions in the pod spec` \n* `Relabel the volume via the CLI command chcon -t container_file_t -R /directory` \n\n```bash\n# Generate yaml from Kubernetes Ressource\npodman generate kube example-pod-name\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEXAMPLE USE-CASES SKOPEO\u003c/summary\u003e\n\n```bash\n# Login to private registry with authentication\nskopeo login --username USER myregistrydomain.com:5000\n# Logout of private registry\nskopeo logout myregistrydomain.com:5000\n```\n```bash\n# Show properties of docker.io/library/alpine\nskopeo inspect docker://docker.io/library/alpine\n```\n```bash\n# Syncing registries\nskopeo sync --src docker --dest dir registry.example.com/busybox /media/usb\n```\n```bash\n# Copy Image\nskopeo copy oci:busybox_ocilayout:latest dir:existingemptydirectory\n# Copy Image with creds\nskopeo copy --src-creds=testuser:testpassword docker://myregistrydomain.com:5000/private oci:local_oci_image\n```\n\n\u003c/details\u003e\n\n## License\n\u003cdetails\u003e\u003csummary\u003eLICENSE\u003c/summary\u003e\n\nCopyright 2020 patrick hermann.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n\u003c/details\u003e\n\nRole history\n----------------\n| date  | who | changelog |\n|---|---|---|\n|2024-30-04  | Andre Ebert | Added Buildah and Skopeo install, added Ansible- and Yamllint with skip rules and collection release workflow\n|2020-10-10  | Patrick Hermann | Updated for using ansible collections, added Debian support; defined stable version\n|2020-04-03  | Patrick Hermann | intial commit for this role on codehub\n\nAuthor Information\n------------------\n\n```yaml\nAndre Ebert (andre.ebert@sva.de); 04/2024\n\nPatrick Hermann (patrick.hermann@sva.de); Stuttgart-Things; 04/2020\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuttgart-things%2Finstall-configure-podman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuttgart-things%2Finstall-configure-podman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuttgart-things%2Finstall-configure-podman/lists"}