启动podman服务
root@localhost:~# loginctl enable-linger user1
user1@localhost:~/ansible$ systemctl --user daemon-reload
user1@localhost:~/ansible$ systemctl --user enable --now podman
user1@localhost:~/ansible$ systemctl --user start podman
user1@localhost:~/ansible$ systemctl --user status podman
安装podman-compose
user1@localhost:~/ansible$ sudo dnf install -y python3-pip
user1@localhost:~/ansible$ pip3 install podman-compose --user
user1@localhost:~/ansible$ which podman-compose
~/.local/bin/podman-compose
user1@localhost:~/ansible$ echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
user1@localhost:~/ansible$ source ~/.bashrc
宿主机安装ansible-navigator sudo dnf install -y python3-pip sudo python3 -m pip install ansible-navigator // 还有一种普通用户安装的方式 命令启动vscode code –user-data-dir ~/.vscode-data 或者直接使用code命令 下载的镜像
ansible-navigator.yml文件
.devcontainer/devcontainer.json文件
.vscode/settings.json文件
获取devcontainer镜像ID替代标签
podman images --no-trunc | grep ansible-dev-tools-rhel8
使用sha256…替换devcontainer.json文件中的镜像位置
开发容器中的案例如下