-
Notifications
You must be signed in to change notification settings - Fork 1
/
Snap Guide.txt
92 lines (67 loc) · 1.84 KB
/
Snap Guide.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
## https://docs.snapcraft.io/build-snaps/get-started-snapcraft
##
# install snapd
sudo apt-get install snapd
# install snapcraft
sudo snap install snapcraft --classic
# check version of snapcraft
snapcraft --version
# install lxd
sudo snap install lxd
sudo lxd init
sudo usermod -g lxd ${USER}
# login again
.....
# test lxd
lxc launch ubuntu:16.04 test
# test a container build
mkdir test-snapcraft
cd test-snapcraft
snapcraft init
snapcraft cleanbuild
###### HELLO WORLD APP
######################
# grade and confinement
grade: stable
confinement: strict
# app
apps:
hello:
command: hello
# part
parts:
gnu-hello:
plugin: autotools
source: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
######################
######################
# install snap
# dangerous is used because it is not signed!
sudo snap install hello_2.10_*.snap --dangerous
###################################################################
# run snapcraft from docker
sudo docker pull snapcore/snapcraft
sudo docker run -v $PWD:$PWD -w $PWD snapcore/snapcraft snapcraft
# grade
grade: stable or devel
# confinement
# if strict security policies should be enforced
confinement: strict or devmode or classic
### NOTE:
### to install devmode, append "--devmode" to CLI
### sudo snap install python36_3.6.4_amd64.snap --dangerous --devmode
### NOTE:
### to install classic confinement, append "--classic" to CLI
### sudo snap install python36_3.6.4_amd64.snap --dangerous --classic
# list snap interfaces
snap interfaces
# debug confinement
# app must be in devmode
sudo snap install snappy-debug
sudo /snap/bin/snappy-debug.security scanlog
### Environment variables
SNAP: /snap/hello-world/27
SNAP_COMMON: /var/snap/hello-world/common
SNAP_DATA: /var/snap/hello-world/27
SNAP_USER_COMMON: /home/zyga/snap/hello-world/common
SNAP_USER_DATA: /home/zyga/snap/hello-world/27