我是一个完全的初学者,我似乎跳过了文档中的一些重要部分,但假设我有这些文件:
$ tree
.
├── snap
│ └── snapcraft.yaml
└── yolo
└── test.txt
其内容snapcraft.yaml
如下:
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
parts:
my-part:
# See 'snapcraft plugins'
plugin: dump
source: yolo
然后我希望snapcraft
在这两个目录的根目录中运行命令并获取一个 snap 文件my-snap-name_0.1_amd64.snap
,然后我可以继续检查该文件unsquashfs -l *.snap
,并且我应该test.txt
在其中的某个地方看到该文件。
我不应该吗?我不明白什么?
答案1
找到答案了:因为我使用了multipass
插件。不知道为什么,但是它不起作用。当我切换到时,它起作用了LXD
:
sudo snap install lxd
sudo lxd init --auto
snapcraft --use-lxd