无法获取图像以访问我在Karton中的项目目录

时间:2019-11-21 01:26:46

标签: docker

我正在尝试在Karton中运行metasploitable-2,并已成功在我的〜/ Projects中创建了一个映像,这也是metasploitable.vmdk文件所在的位置。

在definition.py文件中,我有以下内容

def setup_image(props):
    props.distro = 'ubuntu:devel'

    props.share_path_in_home('Projects')

    props.packages.extend(['build-essential', 'gdb'])

然后我跑步

karton run hacks gcc -o test metasploitable.vmdk

返回

The current directory cannot be accessed in the image:
    /Users/Dave

If you want to make this directory accessible inside the image, you
can modify the definition.py file and share it using one of the
sharing methods:
    - props.share_path(host_path, image_path=None)
    - props.share_path_in_home(relative_path)
For more information, see the DefinitionProperties documentation
at <https://github.com/karton/karton/blob/master/docs/props.md>.

If you want to execute the command without caring about the current
directory, see the documentation about --no-cd and --auto-cd by
typing:

karton help run

有人知道如何正确格式化definition.py文件吗?

0 个答案:

没有答案