我有以下shell脚本,它为rkt / appC创建了一个Debian基础aci容器
#!/bin/sh
set -e
# $ zcat debian.aci | tree | head
# $ rkt run debian.aci --insecure-options=image
export MY_CHROOT=/var/lib/container/aci/debian
mkdir -p $MY_CHROOT
debootstrap --verbose --arch=amd64 --include=iputils-ping,iproute --variant=minbase stable $MY_CHROOT/rootfs http://httpredir.debian.org/debian
cat > $MY_CHROOT/manifest <<EOF
{
"acKind": "ImageManifest",
"acVersion": "0.8.9",
"name": "debian",
"labels": [
{"name": "arch", "value": "amd64"},
{"name": "os", "value": "linux"},
{"name": "version", "value": "1.0.0"}
],
"app": {
"exec": [
"/bin/sh",
"echo",
"Hello, World from $MY_ENV_VAR!"
],
"user": "0",
"group": "0",
"environment": [
{
"name": "MY_ENV_VAR",
"value": "$(whoami)"
}
],
},
"annotations": {
"authors": "Istvan Lantos <email@addess.com>"
}
}
EOF
# use gpg to create a sig, but we'll skip that for now
tar cvvf - $MY_CHROOT/manifest $MY_CHROOT/rootfs | gzip -c > $MY_CHROOT/debian.aci要验证manifest文件是否存在,请执行以下操作:
root@debian:/var/lib/container/aci/debian# zcat debian.aci | tree | head
.
├── debian.aci
├── manifest
└── rootfs
├── bin
│ ├── bash
│ ├── cat
│ ├── chacl
│ ├── chgrp
│ ├── chmod当我尝试使用$ rkt run debian.aci --insecure-options=image命令运行这个容器时,我得到了以下错误:
run: missing manifest我遵循了以下文件结构指南:
https://github.com/appc/spec/blob/master/spec/aci.md#image-layout
https://github.com/appc/spec/blob/master/examples/image.json
为什么不工作呢?
谢谢你的帮助!
发布于 2017-01-06 06:18:37
实际上,该错误是由包含归档中绝对路径的tar引起的。
因此,解决方案是在目录中使用cd,而不使用以$MY_CHROOT为前缀的绝对路径。
https://stackoverflow.com/questions/41494455
复制相似问题