Mua hàng tại Link Shopee hoặc Hotline 0345-148-136.

Podman Linux images on FreeBSD 14.0

bởi

trong

Finally I can run docker / podman Linux container images on FreeBSD.

I just follow podman docs, install Podman and config pf.

1. podman-run

Verify podman can run FreeBSD native image

$ doas podman run --rm docker.io/dougrabson/hello
!... Hello Podman World ...!

         .--"--.
       / -     - \
      / (O)   (O) \
   ~~~| -=(,Y,)=- |
    .---. /`  \   |~~
 ~/  o  o \~~~~.----. ~~
  | =(X)= |~  / (O (O) \
   ~~~~~~~  ~| =(Y_)=-  |
  ~~~~    ~~~|   U      |~~

Project:   https://github.com/containers/podman
Website:   https://podman.io
Documents: https://docs.podman.io
Twitter:   @Podman_io

Test Linux container on FreeBSD

$ doas podman run --rm --os=linux alpine cat /etc/os-release | head -1
Resolving "alpine" using unqualified-search registries (/usr/local/etc/containers/registries.conf)
Trying to pull docker.io/library/alpine:latest...
Getting image source signatures
Copying blob 4abcf2066143 done   |
Copying config 05455a0888 done   |
Writing manifest to image destination
NAME="Alpine Linux"

Test Apache Linux container on FreeBSD

$ doas podman run --os=linux -d --name my-apache-app -p 8080:80 httpd:2.4
Resolving "httpd" using unqualified-search registries (/usr/local/etc/containers/registries.conf)
Trying to pull docker.io/library/httpd:2.4...
Getting image source signatures
Copying blob b60d4b66b268 done   |
Copying blob 87b0fe460fd9 done   |
Copying blob 9cebd3e3b523 done   |
Copying blob 4f4fb700ef54 done   |
Copying blob e1caac4eb9d2 done   |
Copying blob e9304da947c5 done   |
Copying config 2776f4da9d done   |
Writing manifest to image destination
b55fdddbe380de78cce65b1a3e45a5ef84acebe31b8009bc9b98e45916a36768

List running containers

$ doas podman ps -a
CONTAINER ID  IMAGE                        COMMAND           CREATED         STATUS         PORTS                 NAMES
b55fdddbe380  docker.io/library/httpd:2.4  httpd-foreground  34 seconds ago  Up 33 seconds  0.0.0.0:8080->80/tcp  my-apache-app

Test from other computer

2. podman-compose

podman-suite package are not include podman-compose yet.

You’ll need to install it by hand.

Install pipx first

# pkg install devel/py-pipx

Then install podman-compose

$ pipx install podman-compose

There is a bug in pipx version 1.43 here. It will be fixed soon I guess.


Bình luận

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *