2023-03-17 18:21:08 +03:00
# image-forge
2022-12-22 02:46:24 +03:00
2023-02-16 03:16:51 +03:00
## alt images
2022-12-22 02:46:24 +03:00
To build `alt` images, run:
2023-10-26 19:58:21 +03:00
```bash
2022-12-26 02:50:46 +03:00
./build.py -o alt
2022-12-22 02:46:24 +03:00
```
2023-02-16 03:16:51 +03:00
## k8s images
2022-12-22 02:46:24 +03:00
To build `k8s` images for branch `p10` and push to repository `test_k8s` , run:
2023-10-26 19:58:21 +03:00
```bash
2022-12-26 02:50:46 +03:00
./build.py -o k8s -b p10 --overwrite-organization test_k8s --tasks tasks.json --tags tags.json
2022-12-22 02:46:24 +03:00
```
2023-02-16 03:16:51 +03:00
## distroless-images
### create
To create distroless image copy one of existing `org/alt/distroless-*` images.
Or create directory and copy `distroless-example.toml` to it, rename file to
`distroless.toml` and edit.
### build
For example if created image alt/distroless-false and you want to push to
the organization `<ORGANIZATION>` , run:
2023-10-26 19:58:21 +03:00
```bash
2023-02-16 03:16:51 +03:00
./build.py -i alt/distroless-false --overwrite-organization < ORGANIZATION >
```
If you push to the users repository, then organiztion is your username.
2023-10-26 19:59:35 +03:00
2024-11-06 20:27:00 +03:00
## info.yaml format
- `is_versioned` : **bool** (REQUIRED)
Whether to use package version as a tag for this image
- `source_packages` : **list of strings** (REQUIRED)
List of source packages (src.rpm) this image depends on.
If contains jinja2 template syntax, `--package-version`
CLI option must be specified.
- `version_template` : **string** (OPTIONAL)
template to apply when construction the tag,
`version` string variable is available in the template
### examples
#### org/k8s/flannel-cni-plugin
```yaml
is_versioned: true
version_template: v{{ version.rsplit('.', 1) | first }}-flannel{{ version.rsplit('.', 1) | last }}
source_packages:
- cni-plugin-flannel
```
```bash
./build.py -i k8s/flannel-cni-plugin
```
#### org/k8s/kube-apiserver
```yaml
is_versioned: true
version_template: v{{ version }}
source_packages:
- kubernetes{{ version }}
```
```bash
2024-11-06 20:48:24 +03:00
./build.py -b sisyphus -i k8s/kube-apiserver --package-version '{"k8s/kube-apiserver": "1.31"}'
2024-11-06 20:27:00 +03:00
```
#### org/k8s/pause
```yaml
is_versioned: true
source_packages:
- kubernetes-pause
```
```bash
./build.py -i k8s/pause
```
2023-10-26 19:59:35 +03:00
## Dependencies
On x86_64 machine using p10 branch you need:
- `python3-module-tomli`
2024-06-10 16:46:34 +03:00
- `python3-module-jinja2`
2023-10-26 19:59:35 +03:00
- `qemu-user-static-binfmt-aarch64` to build for arm64 architecture
- `qemu-user-static-binfmt-arm` to build for arm architecture
- `qemu-user-static-binfmt-ppc` to build for ppc64le architecture