1VIRT-BOOTSTRAP(1) Container bootstrapping tool VIRT-BOOTSTRAP(1)
2
3
4
6 virt-bootstrap - Setup root file system for libvirt-based containers
7
9 virt-bootstrap URI DEST [OPTIONS]
10
12 virt-bootstrap is a tool providing an easy way to setup the root file
13 system for libvirt-based containers. It allows to use either a tarball
14 containing the file system, an image on a docker registry or virt-
15 builder template and unpacks it either as a folder or in a
16
17 Supported sources are:
18 file:///path/to/rootfs.tar
19 Tar archive which contains root file system
20
21 docker://registry:port/image:tag
22 Docker registry
23
24 virt-builder://template
25 virt-builder templates
26
27 Docker container images are downloaded and the layers are getting
28 cached. If virt-bootstrap is running with effective UID=0 (root) the
29 layersq are cached in "/var/cache/virt-bootstrap/docker_images". For
30 unprivileged users the "~/.cache/virt-bootstrap/docker_images"
31 directory is used. If the environment variable "XDG_CACHE_HOME" is
32 specified then this directory is used instead of "~/.cache".
33
34 The environment variable "VIRTBOOTSTRAP_TMPDIR" can be used to specify
35 temporary directory used by virt-bootstrap or default "/tmp" will be
36 used.
37
39 -f, --format
40 Output format of the root file system. Possible values are dir
41 (default) and qcow2.
42
43 --root-password ROOT_PASSWORD
44 This argument will generate hash from ROOT_PASSWORD and insert the
45 hashed value into "/etc/shadow" in the created root file system.
46
47 If the output format is "qcow2" these modifications are applied in
48 additional qcow2 disk image.
49
50 Note that the "/etc/shadow" file must already exist in the
51 extracted root file system of the container image and it must have
52 entry for root user.
53
54 --no-cache
55 When this flag is used Docker images will be downloaded in
56 temporary directory and discarded after the root file system is
57 extracted.
58
59 --status-only
60 If this flag is used the log messages will be suppresses and only
61 information about the current progress will be displayed.
62
63 -q, --quiet
64 Show only warning and error messages.
65
66 -d, --debug
67 Show debugging output messages.
68
69 -h, --help
70 Display command line help summary.
71
72 --version
73 Show virt-bootstrap's version number and exit.
74
75 Authentication options for accessing private Docker registry
76 Note: If --username argument is specified and --password omitted
77 password prompt will be issued. If --username is omitted the --password
78 argument will be ignored.
79
80 -u, --username USERNAME
81 This argument takes USERNAME to be used to access Docker source registry.
82
83 -p, --password PASSWORD
84 This argument takes PASSWORD to be used to access Docker source
85 registry.
86
87 --not-secure
88 Don't require HTTPS and verification of certificates when talking
89 to Docker registry.
90
91 See "skopeo copy" in skopeo(1)
92
93 UID/GID mapping
94 --uidmap start:target:count
95 Shift UIDs of all root file system entries with some offset. This
96 parameter can be specified multiple times.
97
98 Example: "--uidmap 0:1000:10 --uidmap 500:1500:10" This will map
99 the UIDs: 0-9 to 1000-1009 and 500-509 to 1500-1509
100
101 See "INSTALLATION OPTIONS" in virt-install(1)
102
103 --gidmap start:target:count
104 Shift GIDs of all root file system entries with some offset. This
105 parameter can be specified multiple times.
106
107 Example: "--gidmap 0:1000:10 --gidmap 500:1500:10" This will map
108 the GIDs: 0-9 to 1000-1009 and 500-509 to 1500-1509
109
110 See "INSTALLATION OPTIONS" in virt-install(1)
111
112 --idmap start:target:count
113 Remapping owner and group of all files and directories inside of
114 the root file system. This parameter can be specified multiple
115 times.
116
117 Example: "--idmap 0:1000:10 --idmap 500:1500:10" This will map UIDs
118 and GIDs: 0-9 to 1000-1009 and 500-509 to 1500-1509
119
120 See "INSTALLATION OPTIONS" in virt-install(1)
121
123 Create root file system using Ubuntu image docker.io registry:
124 $ virt-bootstrap docker://ubuntu /tmp/foo
125
126 Create root file system from image stored on private Docker registry:
127 $ virt-bootstrap docker://localhost:5000/ubuntu /tmp/foo \
128 --username testuser \
129 --password testpassoword \
130 --not-secure
131
132 Apply UIDs/GIDs mapping for root file system entries
133 $ virt-bootstrap docker://fedora /tmp/foo \
134 --idmap 0:1000:10
135
136 This above command will map UIDs/GIDs: 0-9 to 1000-1009
137
138 The same result can be achieved with:
139
140 $ virt-bootstrap docker://fedora /tmp/foo \
141 --uidmap 0:1000:10 \
142 --gidmap 0:1000:10
143
144 Multiple mapping values can be specified as follows:
145 $ virt_bootstrap.py docker://ubuntu /tmp/foo \
146 --idmap 0:1000:10 \
147 --idmap 500:1500:10
148
149 This will map the UID/GIDs: 0-9 to 1000-1009 and 500-509 to
150 1500-1509
151
152 Set root password
153 $ virt_bootstrap.py docker://opensuse /tmp/foo \
154 --root-password secret
155
156 The above command will download the "opensuse" container image and
157 extract the root file system to "/tmp/foo". Then it will generate
158 hash of the string "secret" and insert it into
159 "/tmp/foo/etc/shadow" file.
160
161 $ virt_bootstrap.py docker://opensuse /tmp/foo \
162 --root-password secret \
163 -f qcow2
164
165 Similarly for qcow2 format the container image will be downloaded
166 and the root file system will be extracted into qcow2 disk images
167 with backing chains. Then additional qcow2 image will be created
168 with backing file set to the last layer and the modification of
169 "shadow" file will be applied there.
170
172 Written by Cedric Bosdonnat and Radostin Stoyanov
173
174
175
1761.1.0 2017-08-30 VIRT-BOOTSTRAP(1)