@@ -11,15 +11,16 @@ In order to build locally it requires the source trees and softwares mentioned i
11
11
* On Ubuntu:
12
12
13
13
``` bash
14
- $ apt-get install -y qemu-kvm cloud-utils qemu-utils protobuf-compiler pkg-config libdevmapper-dev libgpgme-dev
14
+ apt-get install -y qemu-kvm cloud-utils qemu-utils protobuf-compiler pkg-config libdevmapper-dev libgpgme-dev
15
15
```
16
16
17
17
Finally run the following commands to build the qcow2 image:
18
18
19
19
``` bash
20
- $ export CLOUD_PROVIDER=[aws| azure| ibmcloud| libvirt| vsphere| generic]
21
- $ make image
20
+ export CLOUD_PROVIDER=[aws| azure| ibmcloud| libvirt| vsphere| generic]
21
+ make image
22
22
```
23
+
23
24
** NOTE:** "generic" is a best-effort provider agnostic image creation
24
25
25
26
# How to build within container
@@ -47,11 +48,13 @@ Fedora 39 ([Dockerfile.podvm_builder.fedora](./Dockerfile.podvm_builder)) and RH
47
48
([ Dockerfile.podvm_builder.rhel] ( ./Dockerfile.podvm_builder.rhel ) ).
48
49
49
50
You can create the builder image using the make target by running:
51
+
50
52
``` bash
51
- $ make -C .. podvm-builder
53
+ make -C .. podvm-builder
52
54
```
53
55
54
56
You can optionally customize the builder image, by specify shell variables to the ` make ` command:
57
+
55
58
| Variable | Default value | Description |
56
59
| ------------------- | -------------- | --------------------------------------------------------------- |
57
60
| ` ARCH ` | ` amd64 ` /` s390x ` | Architecture of the podvm image to be built. Defaults to the architecture the of the current machine |
@@ -60,6 +63,7 @@ You can optionally customize the builder image, by specify shell variables to th
60
63
| ` ACTIVATION_KEY ` | ` "" ` | rhel only: the activation key for Red Hat Subscription Management (RHSM) |
61
64
62
65
e.g. to produce an s390x architecture builder image
66
+
63
67
```
64
68
ARCH=s390x make -C .. podvm-builder
65
69
```
@@ -75,7 +79,7 @@ Like the builder image, we have make targets for the binaries image in the paren
75
79
To build the binaries image, use the following command:
76
80
77
81
``` bash
78
- $ BUILDER_IMG=< your_builder_image> make -C .. podvm-binaries
82
+ BUILDER_IMG=< your_builder_image> make -C .. podvm-binaries
79
83
```
80
84
81
85
The build process can take significant time.
@@ -113,9 +117,11 @@ use the QEMU builder in emulation mode when running within container.
113
117
> ** Note:** Beware that the process consume a bunch of memory and disk from the host.
114
118
If the build fails at the point QEMU was launched but packer couldn't
115
119
connect via ssh, with an error similar to:
120
+ >
116
121
> ```
117
122
> Build 'qemu.ubuntu' errored after 5 minutes 57 seconds: Timeout waiting for SSH.
118
123
> ```
124
+ >
119
125
> then it might indicate lack of memory, so try to increase the amount of memory if running on VM.
120
126
121
127
The podvm image can be built for other architectures than `x86_64` by passing
@@ -130,14 +136,17 @@ $ docker build -t podvm_s390x \
130
136
```
131
137
132
138
The Secure Execution enabled podvm image can be built by passing the ` SE_BOOT ` build argument to docker. Currently this is only supported for Ubutu ` s390x ` , which also needs put the ` HOST KEY documents ` to the [ files] ( files ) folder, please follow the ` Download host key document from Resource Link ` section at [ this document] ( ../ibmcloud/SECURE_EXECUTION.md ) to download ` HOST KEY documents ` .
139
+
133
140
``` bash
134
141
$ tree -L 1 files
135
142
files
136
143
├── HKD-8562-1234567.crt
137
144
├── etc
138
145
└── usr
139
146
```
147
+
140
148
Running below command will build the Secure Execution enabled qcow2 image:
149
+
141
150
``` bash
142
151
$ docker build -t se_podvm_s390x \
143
152
--build-arg ARCH=s390x \
@@ -174,12 +183,13 @@ file out of the podvm container image.
174
183
Running the below command will extract the qcow2 image built in the previous step.
175
184
176
185
``` bash
177
- $ ./hack/download-image.sh podvm:latest . -o podvm.qcow2
186
+ ./hack/download-image.sh podvm:latest . -o podvm.qcow2
178
187
```
188
+
179
189
Running the below command will extract the Secure Execution enabled qcow2 image built in the previous step.
180
190
181
191
``` bash
182
- $ ./hack/download-image.sh se_podvm_s390x:latest . -o se_podvm.qcow2
192
+ ./hack/download-image.sh se_podvm_s390x:latest . -o se_podvm.qcow2
183
193
```
184
194
185
195
# How to add support for a new Linux distribution
@@ -189,7 +199,7 @@ In order to add a new Linux distribution essentially it is needed to create some
189
199
Follow the steps below, replacing ` DISTRO ` with the name of the distribution being added:
190
200
191
201
1 . Create the builder dockerfile by copying ` Dockerfile.podvm_builder ` to ` Dockerfile.podvm_builder.DISTRO ` and
192
- adjusting the file properly (e.g. replace ` FROM ubuntu:20 .04 ` with ` FROM DISTRO ` ). Try to keep the same
202
+ adjusting the file properly (e.g. replace ` FROM ubuntu:24 .04 ` with ` FROM DISTRO ` ). Try to keep the same
193
203
software versions (e.g. Golang) as much as possible.
194
204
2 . Create the podvm image dockerfile by copying ` Dockerfile.podvm ` to ` Dockerfile.podvm.DISTRO ` and adjusting the file
195
205
properly likewise. In particular, the * PODVM_DISTRO* and * BUILDER_IMG* arguments should be changed.
0 commit comments