首页 > 其他分享 >Debian12安装podman

Debian12安装podman

时间:2023-10-08 11:57:36浏览次数:39  
标签:non rambo mirrors free podman https Debian12 安装 debian

目录

前奏

更换国内源

rambo@debian:~$ sudo cat /etc/issue
Debian GNU/Linux 12 \n \l


rambo@debian:~$ cat /etc/apt/sources.list
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib

安装podman

安装方法1

rambo@debian:~$ sudo apt -y update && sudo apt -y upgrade 
rambo@debian:~$ sudo reboot -f
rambo@debian:~$ sudo apt install -y podman
rambo@debian:~$ podman version
Client:       Podman Engine
Version:      4.7.1
API Version:  4.7.1
Go Version:   go1.21.2
Built:        Wed Dec 31 19:00:00 1969
OS/Arch:      linux/amd64



# 卸载podman
sudo autoremove  --purge  podman

安装方法2

rambo@debian:~$ sudo apt install -y curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates -y
rambo@debian:~$ source  /etc/os-release
rambo@debian:~$ wget http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_$VERSION_ID/Release.key -O alvistack_key
rambo@debian:~$ cat alvistack_key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/alvistack.gpg  >/dev/null
rambo@debian:~$ echo "deb http://downloadcontent.opensuse.org/repositories/home:/alvistack/Debian_$VERSION_ID/ /" | sudo tee  /etc/apt/sources.list.d/alvistack.list
rambo@debian:~$ sudo apt -y update
rambo@debian:~$ sudo apt install -y podman 
rambo@debian:~$ podman version

安装后设置

rambo@debian:~$ sudo vim /etc/containers/registries.conf           # 全局
# rambo@debian:~$ sudo vim ~/.config/containers/registries.conf    # 本地
....
    ....
[[registry]]
prefix = "docker.io"
location = "docker.m.daocloud.io"

[[registry]] 
prefix = "docker.io"
insecure = false
blocked = false
location = "docker.io"
[[registry.mirror]]
location = "hub-mirror.c.163.com"
[[registry.mirror]]
location = "registry.docker-cn.com"


示例1

rambo@debian:~$ podman pull docker.io/library/nginx:latest
rambo@debian:~$ podman images

rambo@debian:~$ vim Dockerfile
FROM ubuntu:20.04
RUN apt-get update -y
ENV DEBIAN_FRONTEND=noninteractive 
RUN apt install -y gnupg apt-transport-https apt-utils wget
RUN echo "deb https://notesalexp.org/tesseract-ocr5/focal/ focal main" \
|tee /etc/apt/sources.list.d/notesalexp.list > /dev/null
RUN wget -O - https://notesalexp.org/debian/alexp_key.asc | apt-key add -
RUN apt-get update -y
RUN apt-get install tesseract-ocr -y
RUN apt install imagemagick -y
ENTRYPOINT ["tesseract"]
RUN tesseract -v


rambo@debian:~$ podman build . -t tesseract:latest

示例2

rambo@debian:~$ podman pull docker.io/library/debian
rambo@debian:~$ podman run -itd --name test1 docker.io/library/debian:latest
4fa90d389a5148474bed021f0568f1c060aa2e30ca82488a8d248edd3c05d8e8
rambo@debian:~$ podman exec -it test1 /bin/bash
root@4fa90d389a51:/# cat /etc/issue
Debian GNU/Linux 12 \n \l

做别名
rambo@debian:~$ echo '' | sudo tee /etc/containers/nodocker
rambo@debian:~$ echo "alias docker='/usr/bin/podman'" >> .bashrc
rambo@debian:~$ source .bashrc

关于docker镜像列表(非podman)

无需登录:
Azure 中国镜像 - https://dockerhub.azk8s.cn
科大镜像站 - https://docker.mirrors.ustc.edu.cn
七牛云 - https://reg-mirror.qiniu.com
网易云 - https://hub-mirror.c.163.com
腾讯云 - https://mirror.ccs.tencentyun.com


需登录:
DaoCloud - http://<your_code>.m.daocloud.io
阿里云 - https://<your_code>.mirror.aliyuncs.com


vim /etc/docker/daemon.json
{
    "registry-mirrors": [
        "https://docker.mirrors.ustc.edu.cn",
        "https://reg-mirror.qiniu.com"
    ]
}


sudo systemctl daemon-reload
sudo systemctl restart docker

标签:non,rambo,mirrors,free,podman,https,Debian12,安装,debian
From: https://www.cnblogs.com/smlile-you-me/p/17744782.html

相关文章

  • Docker安装报错处理
    一、安装Docker报错公钥尚未安装              【解决办法】:     1、查看系统版本信息cat/etc/redhat-release                  2、从开源镜像站mirrors.163.com找到系统对应秘钥       ......
  • linux跳过cmake,安装高版本的wgrib2
    一、安装依赖包yumgroupinstall'DevelopmentTools'yuminstallzlib-devel-yyuminstalllibpng-devel-yyuminstallopenssl-devel-yyum-yinstallgccgcc-c++opensslopenssl-develtar二、下载wgrib2编译包并且解压,修改makefiletarxvfwgrib2.tgz.v3.1.2......
  • 安装配置kvm虚拟机,并创建虚拟机
    1、开启宿主机的CPU虚拟化功能编辑虚拟机设置--处理器--勾选虚拟化IntelVT-x/EPT或AMD-V/RVI(V).2、验证是否开启虚拟化支持[root@KVM~]#grep-Em1"vmx|svm"/proc/cpuinfoflags:fpuvmedepsetscmsrpaemcecx8apicsepmtrrpgemcacmovpatpse3......
  • ansible-playbook批量安装httpd,按主机名提供不同的index.html(如node1的index.html欢迎
    [root@ansible~]#vim/etc/ansible/hosts[webservers]10.0.0.150ansible_connection=local10.0.0.160#创建角色相关目录[root@ansiblehtml]#mkdir-pv/data/ansible/roles/httpd/{tasks,handlers,files}mkdir:createddirectory'/data/ansible'mkdir:crea......
  • 编译安装redis
    #安装依赖包[root@centos7~]#yum-yinstallgccjemalloc-devel#下载源码[root@centos7~]#wgethttp://download.redis.io/releases/redis-5.0.7.tar.gz[root@centos7~]#tarxvfredis-5.0.7.tar.gz#编译安装[root@centos7~]#cdredis-5.0.7/[root@centos7redis-5.......
  • 编写脚本实现tomcat一键安装8.5版本
    #下载包到/root目录[root@tomcat~]#lljdk-8u212-linux-x64.tar.gzapache-tomcat-8.5.82.tar.gz-rw-r--r--1rootroot10610025Aug2717:14apache-tomcat-8.5.82.tar.gz-rw-r--r--1rootroot195013152Aug2717:08jdk-8u212-linux-x64.tar.gz#编写脚本[root@to......
  • wsl中matplotlib安装中文字体
    wsl中matplotlib安装中文字体首先修改matplotlib配置的中文字体使用python定位字体路径importmatplotlibmatplotlib.matplotlib_fname()打开电脑的C:windows/fonts下,查找yahei关键字,将微软雅黑ttf字体拷贝,扔到wsl中显示的路径下的fonts/ttf文件夹里面。删除matplot......
  • Python基础环境安装
    环境安装记录,便以后直接一套执行一、准备1.Python下载地址:https://www.python.org/downloads/windows/2.卸载①控制面板寻找Python直接卸载;②查看环境变量path中python的变量,找到对应文件夹,将文件夹删除,后在删除环境变量中有关python的变量;③Win+R运行"regedit"打开注......
  • Centos安装网卡驱动make时报错Kernel header files not in any of the expected locat
      Centos安装I219-LM网卡驱动  https://www.cnblogs.com/marixh/p/16927623.html查询适合我的网卡命令:12[root@192src]#lspci|grepnet00:1f.6Ethernetcontroller:IntelCorporationEthernetConnection(11)I219-LM发现适合我的版本是Int......
  • 下载、安装CAN-EYE植被参数工具
      本文介绍植被指数计算软件CAN-EYE的下载、安装方法。  CAN-EYE软件是由法国国家农业研究院(FrenchNationalInstituteofAgriculturalResearch,INRA)下属的EMMAH实验室(MediterraneanEnvironmentandAgro-hydroSystemModelling)开发的免费软件,用以从鱼眼镜头、普通镜头所......