summaryrefslogtreecommitdiff
path: root/containers/README.md
blob: 0dabc0837423fa0fcefc51075e272d8afac084e0 (plain)
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
# Container Guide
## Description
The directories for containers serve the purpose of obtaining container image tar files. You can get these image tar files through a Dockerfile, by pulling images from a registry, or by downloading tar files from URLs and other sources. There are many directories, with each one corresponding to a specific job. One job can depend on another job.
## Structure
The job structure of Container  is as follows:
```
dirs/
    files/
    templates/
    build.mk
    Dockerfile.j2
    manifest.yaml
```
### files/
Contains files used with the copy resource.
### templates/
Contains files used with the template resource.
### build.mk
The `build.mk` file is included by the top-level Makefile in the containers directory for builds. `build.mk` defines `Makefile rules`, which generate both `file targets`(build/{{rule_name}}/build.done) and `phony targets`. This file supports the following variables, allowing you to set these variables to modify the content of the Makefile rules.
```
rule_name              # Makefile rule name.
rule_prerequisites:    # Makefile rule prerequisites.
rule_recipes           # Makefile rule recipes.
```
### Dockerfile.j2 (Optional)
A template file for generating a Dockerfile. If container images are not generated using a Dockerfile, this file is not required.
### manifest.yaml (Optional)
A data file used for rendering the Dockerfile. If container images are not generated using a Dockerfile, this file is also not required. 
This file configures how to install online RPMs within a Dockerfile. The process involves two steps: downloading and installing the RPMs.
```
name                      # The name of the RPM.
version                   # The version of the RPM.
url                       # The download URL for the RPM (required if download_command is specified).
download_command          # The command to download the RPM. Supported values: dnf and curl.
download_command_options  # Options for the download command.
install_command           # The command to install the RPM. Supported values: dnf and rpm.
install_command_options   # Options for the install command.
```
## Build
To start the build process, enter the containers directory and run the following command:
```
make YUM_REPO_FILE=/directory/path/yum.conf IMAGE_TAG=v1.0.0
```
- `YUM_REPO_FILE` specifies the path to the YUM repository configuration file.
- `IMAGE_TAG` sets the version tag for the container image.

Once the build is complete, the image tar files will be available in the `build/images` directory.