podman基本操作
podman的操作和docker是一样的
- 拉取镜像
[root@host ~]# podman pull httpd
Resolving "httpd" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/library/httpd:latest...
Getting image source signatures
Copying blob 33847f680f63 skipped: already exists
Copying blob 763d74736d95 done
Copying blob a8c75048351a done
Copying blob d74938eee980 done
Copying blob 963cfdce5a0c done
Copying config bde40dcb22 done
Writing manifest to image destination
Storing signatures
bde40dcb22a7a82392a45bcc7f191bb2f807d57711934d4eda869d3d649a3643
- 运行容器
[root@host ~]# podman run -d --name t1 -p 80 docker.io/library/httpd
c035037877efeb0523b81865f2b677407fb2f0e6bd174e2b029f1ad9dd834254
[root@host ~]# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c035037877ef docker.io/library/httpd:latest httpd-foreground 9 seconds ago Up 8 seconds ago 0.0.0.0:35965->80/tcp t1
#-l 查看最新的容器信息
[root@host ~]# podman inspect -l
[
{
"Id": "c035037877efeb0523b81865f2b677407fb2f0e6bd174e2b029f1ad9dd834254",
"Created": "2021-08-12T10:44:14.434329075-04:00",
"Path": "httpd-foreground",
"Args": [
"httpd-foreground"
],
"State": {
"OciVersion": "1.0.2-dev",
"Status": "running",
......
[root@host ~]# curl 192.168.149.143:35965
<html><body><h1>It works!</h1></body></html>
- podman logs查看容器日志
[root@host ~]# podman logs -l
AH00558: httpd: Could not reliably determine the server