首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >创建工件时出错:找不到资源

创建工件时出错:找不到资源
EN

Stack Overflow用户
提问于 2015-11-17 13:57:49
回答 1查看 1.5K关注 0票数 1

我是刚开始使用封隔器,我想得到一些帮助,我有一个问题。我似乎找不到关于这个错误的任何信息。此错误既发生在我的本地计算机上,也出现在推送后的地图集中。

运行Packer v.0.8.7.dev

请帮我一把!

错误:

代码语言:javascript
复制
==> virtualbox-iso: Running post-processor: atlas
    virtualbox-iso (atlas): Creating artifact: /
Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: Error creating artifact: resource not found

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: Error creating artifact: resource not found

==> Builds finished but no artifacts were created.

配置:

代码语言:javascript
复制
{
    "push": {
      "name": "",
      "vcs": true
    },
    "variables": {
        "atlas_username": "{{env `ATLAS_USERNAME`}}",
        "atlas_name": "{{env `ATLAS_NAME`}}"
    },
    "provisioners": [
        {
            "type": "shell",
            "scripts": [
                "scripts/base.sh",
                "scripts/virtualbox.sh",
                "scripts/vmware.sh",
                "scripts/vagrant.sh",
                "scripts/dep.sh",
                "scripts/cleanup.sh",
                "scripts/zerodisk.sh",
                "scripts/custom.sh"
            ],
            "override": {
                "virtualbox-iso": {
                    "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
                },
                "vmware-iso": {
                    "execute_command": "echo 'vagrant'|sudo -S bash '{{.Path}}'"
                }
            }
        }
    ],
    "builders": [
        {
            "type": "virtualbox-iso",
            "boot_command": [
                "<esc><esc><enter><wait>",
                "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
                "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
                "hostname={{ .Name }} ",
                "fb=false debconf/frontend=noninteractive ",
                "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
                "initrd=/install/initrd.gz -- <enter>"
            ],
            "headless": false,
            "boot_wait": "10s",
            "disk_size": 20480,
            "guest_os_type": "Ubuntu_64",
            "http_directory": "http",
            "iso_checksum": "c2571c4c2fc17bef1fad9e5db5e7afdb4bd29cd8ab51e42f9c036238c4e54caa",
            "iso_checksum_type": "sha256",
            "iso_url": "http://ftp.acc.umu.se/mirror/cdimage.ubuntu.com/releases/14.04/release/ubuntu-14.04.3-server-amd64+mac.iso",
            "ssh_username": "vagrant",
            "ssh_password": "vagrant",
            "ssh_port": 22,
            "ssh_wait_timeout": "10000s",
            "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'",
            "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
            "virtualbox_version_file": ".vbox_version"
        },
        {
            "type": "vmware-iso",
            "boot_command": [
                "<esc><esc><enter><wait>",
                "/install/vmlinuz noapic preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
                "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
                "hostname={{ .Name }} ",
                "fb=false debconf/frontend=noninteractive ",
                "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ",
                "initrd=/install/initrd.gz -- <enter>"
            ],
            "boot_wait": "10s",
            "disk_size": 20480,
            "guest_os_type": "Ubuntu-64",
            "headless": true,
            "http_directory": "http",
            "iso_checksum": "af224223de99e2a730b67d7785b657f549be0d63221188e105445f75fb8305c9",
            "iso_checksum_type": "sha256",
            "iso_url": "http://releases.ubuntu.com/precise/ubuntu-12.04.5-server-amd64.iso",
            "skip_compaction": true,
            "ssh_username": "vagrant",
            "ssh_password": "vagrant",
            "ssh_port": 22,
            "ssh_wait_timeout": "10000s",
            "shutdown_command": "echo '/sbin/halt -h -p' > shutdown.sh; echo 'vagrant'|sudo -S bash 'shutdown.sh'",
            "tools_upload_flavor": "linux"
        }
    ],
    "post-processors": [
        [{
            "type": "vagrant",
            "keep_input_artifact": true
        },
        {
            "type": "atlas",
            "only": ["vmware-iso"],
            "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}",
            "artifact_type": "vagrant.box",
            "metadata": {
                "provider": "vmware_desktop",
                "version": "0.0.1"
            }
        },
        {
            "type": "atlas",
            "only": ["virtualbox-iso"],
            "artifact": "{{user `atlas_username`}}/{{user `atlas_name`}}",
            "artifact_type": "vagrant.box",
            "metadata": {
                "provider": "virtualbox",
                "version": "0.0.1"
            }
        }]
    ]
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-11-18 22:38:30

你会得到

代码语言:javascript
复制
virtualbox-iso (atlas): Creating artifact: /

看来你的变量来自

代码语言:javascript
复制
"variables": {
    "atlas_username": "{{env `ATLAS_USERNAME`}}",
    "atlas_name": "{{env `ATLAS_NAME`}}"
},

没有正确设置--确保设置了它们,或者一开始尝试硬编码。

另外,在最新的文档中,它建议使用atlas_token来访问地图集。

代码语言:javascript
复制
"post-processors": [
  {
    "type": "atlas",
    "only": ["virtualbox-iso"],
    "token": "{{user `atlas_token`}}",
    "artifact": "hashicorp/foobar",
    "artifact_type": "vagrant.box",
    "metadata": {
      "provider": "virtualbox",
      "version": "0.0.1"
      "created_at": "{{timestamp}}"
    }
  }
]
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33758793

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档