DEV Community

Pramoth Suwanpech
Pramoth Suwanpech

Posted on

2 1

ลองใช้ Podman แทน Docker ใน CentOS 8

Podman เป็น container engine เหมือน Docker แต่ว่า Podman ไม่ต้องมี daemon process(dockerd) ซึ่งทำให้เราสามารถรัน container ได้โดยไม่จำเป็นต้องเป็น root

Podman ติดตั้งมาพร้อมกับ CentOS 8 เลย ดังนั้นสามารถรัน container ได้เลย สะดวกดี

เราจะยืม docker command จาก docker getting start มาลองกัน

podman run hello-world
Trying to pull registry.access.redhat.com/hello-world...
  name unknown: Repo not found
Trying to pull registry.fedoraproject.org/hello-world...
  manifest unknown: manifest unknown
Trying to pull registry.centos.org/hello-world...
  manifest unknown: manifest unknown
Trying to pull docker.io/library/hello-world...
Getting image source signatures
Copying blob 1b930d010525 done
Copying config fce289e99e done
Writing manifest to image destination
Storing signatures

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

สังเกตว่า podman จะไปหา image ที่
registry.access.redhat.com
registry.fedoraproject.org
docker.io/library
ตามลำดับ ซึ่งไฟล์ config ของ repo ก็อยู่ที่ /etc/containers/registries.conf

ลองใช้ podman ps -a หรือ podman container ls -a

podman container ls -a
CONTAINER ID  IMAGE                                 COMMAND    CREATED         STATUS                     PORTS  NAMES
0175e1d84375  docker.io/library/hello-world:latest  /hello     22 minutes ago  Exited (0) 22 minutes ago         zealous_leakey
a82ca14e379b  docker.io/library/alpine:latest       sh         42 hours ago    Up 42 hours ago                   gallant_ellis
493b3889a145  docker.io/library/alpine:latest       /bin/bash  42 hours ago    Created                           vigilant_volhard
fc53c0e17871  docker.io/library/alpine:latest       /bash/bin  42 hours ago    Created                           pensive_buck

คำสั่งของ podman ก็จะเหมือน docker ดังนั้นเราสามารถใช้แทน docker ได้เลย

alias docker=podman

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay