在 buildah 容器内运行多个命令,由命令行中的布尔 AND (&&) 运算符分隔

Ear*_*ome 2 buildah

如何在主机命令行中使用 bash 的布尔 AND 运算符在容器内运行多个命令?buildah&&

这是我的问题的一个示例,从图像开始debian

$ buildah pull debian:buster && container=$(buildah from debian:buster)
$ buildah run $container -- apt -y update && apt -y upgrade
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
bash: apt: command not found...
Install package 'apt' to provide command 'apt'? [N/y]
Run Code Online (Sandbox Code Playgroud)

&&我的主机 shell 解释命令之外的布尔值 AND buildah。我的期望是拥有布尔值的右侧并在buildah容器内运行。

小智 5

怎么样?

buildah 运行 $container -- sh -c 'apt -y update && apt -y Upgrade'。