podman容器的开机自启
podman容器的开机自启
[root@cxr ~]# podman pull busybox
Resolved "busybox" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/busybox:latest...
Getting image source signatures
Copying blob 5cc84ad355aa done
Copying config beae173cca done
Writing manifest to image destination
Storing signatures
beae173ccac6ad749f76713cf4440fe3d21d1043fe616dfbe30775815d1d0f6a
[root@cxr ~]# podman run --name test -dit docker.io/library/busybox
WARN[0000] Ignoring global metacopy option, not supported with booted kernel
5a27696f3351fa9a80b81c1d7c90aa781eddbc47774340baa241572f6070ae87
[root@cxr ~]# podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
388bf8e619a0 docker.io/library/nginx:latest nginx -g daemon o... 53 minutes ago Up 53 minutes ago 0.0.0.0:8080->80/tcp web
5a27696f3351 docker.io/library/busybox:latest sh 28 seconds ago Up 28 seconds ago test
[root@cxr ~]# podman generate systemd --files --name test
/root/container-test.service
[root@cxr ~]# podman generate systemd --files --name test --new
/root/container-test.service
[root@cxr ~]# mv container-test.service /usr/lib/systemd/system/
[root@cxr ~]# systemctl daemon-reload
[root@cxr ~]# setenforce 0
[root@cxr ~]# vim /etc/selinux/config SELINUX=disabled[root@cxr ~]# systemctl enable --now container-test.service
Created symlink /etc/systemd/system/default.target.wants/container-test.service → /usr/lib/systemd/system/container-test.service.
[root@cxr ~]# reboot 连接断开
连接成功
Activate the web console with: systemctl enable --now cockpit.socketLast login: Tue May 10 02:52:36 2022 from 192.168.106.1
[root@cxr ~]# podman ps //可以看到已经开机自启了
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f56bd4002398 docker.io/library/busybox:latest sh 9 seconds ago Up 7 seconds ago test
普通用户
[root@cxr ~]# useradd jerry
[root@cxr ~]# su - jerry[jerry@cxr ~]$ podman pull busybox
Resolved "busybox" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/busybox:latest...Getting image source signatures
Copying blob 3cb635b06aa2 done
Copying config ffe9d497c3 done
Writing manifest to image destination
Storing signatures
ffe9d497c32414b1c5cdad8178a85602ee72453082da2463f1dede592ac7d5af[jerry@cxr ~]$ podman run --name test -dit docker.io/library/busybox
b1cbea168be3ced718bdae93c4c6cdc7405d0f0f9380c856e3d76d9496901c60
[jerry@cxr~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b1cbea168be3 docker.io/library/busybox:latest sh 5 seconds ago Up 5 seconds ago test#创建service文件
[jerry@cxr ~]$ podman generate systemd --files --name test --new
/home/jerry/container-test.service
[jerry@cxr ~]$ ls
container-test.service[jerry@cxr ~]$ mkdir -p ~/.config/systemd/user
[jerry@cxr ~]$ mv container-test.service ~/.config/systemd/user[jerry@cxrt ~]$ systemctl --user status container-test.service
● container-test.service - Podman container-test.serviceLoaded: loaded (/home/jerry/.config/systemd/user/container-test.service; enabled; vendor preset: enabled)Active: active (running) since Wed 2022-5-23 22:31:21 CST; 10s agoDocs: man:podman-generate-systemd(1)Process: 107992 ExecStopPost=/usr/bin/podman rm -f --ignore --cidfile=/run/user/1002/container-test.service.ctr-id (code=exited, status=125)Process: 108050 ExecStartPre=/bin/rm -f /run/user/1002/container-test.service.ctr-id (code=exited, status=0/SUCCESS)Main PID: 108141 (conmon)CGroup: /user.slice/user-1002.slice/user@1002.service/container-test.service├─108134 /usr/bin/fuse-overlayfs -o ,lowerdir=/home/jerry/.local/share/containers/storage/overlay/l/7EWWT2U3CWUJFPIPVXBNGBWGFI,upperdir=/home/jerry/.local/share/>├─108138 /usr/bin/slirp4netns --disable-host-loopback --mtu=65520 --enable-sandbox --enable-seccomp -c -e 3 -r 4 --netns-type=path /run/user/1002/netns/cni-370af>├─108141 /usr/bin/conmon --api-version 1 -c 4ca23486d3ab0cb9a230265df8b9d5a666bfdfbd42785ac90b92bf965a4b37cc -u 4ca23486d3ab0cb9a230265df8b9d5a666bfdfbd42785ac90>└─108144 sh[jerry@cxr ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
4ca23486d3ab docker.io/library/busybox:latest sh 19 seconds ago Up 19 seconds ago
podman容器的开机自启相关推荐
- 安装docker和docker的开机启动及容器的开机自启
前提条件 目前,CentOS 仅发行版本中的内核支持 Docker. Docker 运行在 CentOS 7 上,要求系统为64位.系统内核版本为 3.10 以上. Docker 运行在 CentOS ...
- podman 开机自启
一,配置加速器 [root@localhost ~]# vim /etc/containers/registries.confunqualified-search-registries = [&quo ...
- podman容器开机自启(root用户与普通用户)
文章目录 podman容器开机自启(root用户与普通用户) 1.运行容器 2.配置开机自启动文件 3.重新加载并启动查看 4.podman普通用户的使用 5.podman网络设置 6.podman网 ...
- podman开机自启
podman开机自启 创建一个容器 [root@localhost ~]# podman create --name web httpd 07beb70e089c685e907a66a43360735 ...
- docker mysql开机自启动_Docker学习4-学会如何让容器开机自启服务【坑】
前言 小龙亲测重启服务器后 docker 容器没跑起来,相信有不少小伙伴在用docker部署容器的时候也发现每次开机服务就没有自启了,需要手动去执行把容器服务开启起来,但有没有可以让它开机自启呢?显然 ...
- docker mysql开机自启动_Docker 学会让容器开机自启服务
广深小龙亲测重启服务器后 docker 容器没跑起来,相信有不少小伙伴在用 docker 部署容器的时候也发现每次开机服务就没有自启了,需要手动去执行把容器服务开启起来,但有没有可以让它开机自启呢?显 ...
- Podman容器 [2022]
Podman 总目标:在一个 RHEL 服务器上获取.运行和管理作为容器的简单轻量级服务 目标: 解释容器是什么,及如何管理和部署具有软件库和依赖的应用程序 安装容器管理工具,并运行一个简单的无根容器 ...
- Docker、Podman 容器“扫盲“ 学习笔记【与云原生的故事】
[摘要] 笔记内容:由理论和具体docker常用操作构成.这篇博文笔记的定位是:温习,查阅,不适合新手学习.你拥有青春的时候,就要感受它,不要虚掷你的黄金时代,不要去倾听... 写在前面 笔记内容:由 ...
- Docker、Podman 容器“扫盲“ 学习笔记
写在前面 之前只是做毕业设计时,接触一点,用DockFile在阿里云上部署了毕设.后来docker端口问题,机器被植入木马,拉去挖矿,cup天天爆满,百度半天删了好多文件不管用,后来恢复镜像了,之后在 ...
最新文章
- Spark _18 _Shuffle文件寻址
- 类属性和实例属性冲突
- git批量删除文件和批量提交
- Android 应用开发(36)---LinearLayout(线性布局)
- qemu-kvm 代码分析
- 【每日一linux命令4】常用参数:
- 超全必读!NLP 事件抽取综述(下)
- 帝豪gl车机系统降级_鲜试车丨10万元级国民轿车再升级,试驾2020款吉利帝豪GL...
- mysql 主从同步 错误_MySQL 主从同步错误(error)解决
- QT5.13.1安装教程
- 微信小程序 # 仿写微信通讯录页面(字母侧栏效果)
- LSTM神经网络介绍
- [浅析]UE4关卡流
- 多个图片如何批量转成文字版的Word
- sqlmap用法详解
- jumpserver 添加Windows主机
- dot全称_求魔兽世界中的缩写全称
- 搜索引擎Google的小秘密
- 服务器灾备解决方案--两地三中心(图文详解)
- 从一个微服务应用的成功落地,谈企业需要什么样的微服务治理