【问题标题】:"Missing manifest" error at $ rkt run$ rkt 运行时出现“缺少清单”错误
【发布时间】:2017-05-20 13:15:28
【问题描述】:

我有以下 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

https://github.com/appc/spec/blob/master/spec/aci.md#image-layout

https://github.com/appc/spec/blob/master/examples/image.json

为什么不工作?

感谢您的帮助!

【问题讨论】:

    标签: rkt appcelerator


    【解决方案1】:

    实际上,错误是由tar引起的,其中包含存档中的绝对路径。

    所以解决办法是在目录下cd,不要使用以$MY_CHROOT为前缀的绝对路径。

    来源:https://unix.stackexchange.com/a/59246/120771

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-10
      • 1970-01-01
      • 1970-01-01
      • 2016-11-28
      • 2016-09-02
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多