Cara Membuat Rootless Container Podman Bisa Dikelola Sebagai Service

Prasyarat Podman Panduan Sebagai contoh kita akan membuat container nginx pada non-root user bernama student Buat direktori untuk menyimpan konten mkdir website echo '<h1>Halo Dunia!</h1>' > website/index.html Buat container nginx podman run -d --name websiteku -p 8080:80 -v ~/website:/usr/share/nginx/html:Z nginx Verifikasi container podman ps curl localhost:8080 Contoh output [student@podman-host ~]$ podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 109ed419f29e docker.io/library/nginx:latest nginx -g daemon o... About a minute ago Up About a minute ago 0.0.0.0:8080->80/tcp websiteku [student@podman-host ~]$ curl localhost:8080 <h1>Halo Dunia!</h1> Buat direktori untuk menyimpan service systemd container mkdir -p ~/.config/systemd/user/ Generate service systemd cd ~/.config/systemd/user/ podman generate systemd --name websiteku --files --new Hentikan dan hapus container yang telah dibuat podman stop websiteku podman rm websiteku Jalankan dan enable service container-websiteku systemctl --user daemon-reload systemctl --user enable --now container-websiteku Aktifkan linger pada user student # Jalankan sebagai user student loginctl enable-linger Catatan! linger berfungsi agar systemd service user yang telah dienable dapat berjalan saat system boot ...

August 23, 2021 · 1 min · Aji Arya

Cara Install Podman, Skopeo, dan Buildah Pada Linux (CentOS/Rocky)

Panduan Periksa versi yang tersedia untuk diinstall sudo dnf module list container-tools Contoh keluaran pada Rocky Linux [student@rocky ~]$ sudo dnf module list container-tools Last metadata expiration check: 0:23:42 ago on Tue Aug 10 15:24:06 2021. Rocky Linux 8 - AppStream Name Stream Profiles Summary container-tools rhel8 [d] common [d] Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and updated as frequently as every 12 weeks. container-tools 1.0 common [d] Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and supported for 24 months. container-tools 2.0 common [d] Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page. container-tools 3.0 common [d] Stable versions of podman 3.0, buildah 1.19, skopeo 1.2, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page. Install container-tools sudo dnf module install container-tools:<stream>/<profile> Contoh install versi 3.0 dengan profil common sudo dnf module install container-tools:3.0/common

August 10, 2021 · 1 min · Aji Arya