-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe14e57
commit c1ab59c
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""KEA DHCP Server BCI container""" | ||
|
||
from bci_build.os_version import ALL_NONBASE_OS_VERSIONS | ||
from bci_build.os_version import CAN_BE_LATEST_OS_VERSION | ||
from bci_build.package import ApplicationStackContainer | ||
from bci_build.package.versions import get_pkg_version | ||
|
||
_BASE_PODMAN_KEA_CMD = "podman run --replace -it --privileged --network=host" | ||
_KEA_DHCP4_CONFIG_PATH = "/etc/kea/kea-dhcp4.conf" | ||
_KEA_DHCP6_CONFIG_PATH = "/etc/kea/kea-dhcp6.conf" | ||
|
||
KEA_DHCP_CONTAINERS = [] | ||
|
||
for os_version in ALL_NONBASE_OS_VERSIONS: | ||
KEA_DHCP_CONTAINERS.append( | ||
ApplicationStackContainer( | ||
name="kea", | ||
os_version=os_version, | ||
tag_version=get_pkg_version("keadhcp", os_version), | ||
is_latest=os_version in CAN_BE_LATEST_OS_VERSION, | ||
pretty_name="Kea DHCP Server Container", | ||
package_list=["kea", "util-linux"], | ||
custom_end=""" | ||
RUN mkdir -p /var/run/kea | ||
""", | ||
extra_labels={ | ||
"run": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v /etc/kea:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", | ||
"runcwd": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp4 -v .:/etc/kea IMAGE kea-dhcp4 -c {_KEA_DHCP4_CONFIG_PATH}", | ||
"run_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v /etc/kea:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", | ||
"runcwd_dhcp6": f"{_BASE_PODMAN_KEA_CMD} --name kea-dhcp6 -v .:/etc/kea IMAGE kea-dhcp6 -c {_KEA_DHCP6_CONFIG_PATH}", | ||
}, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# KEA DHCP Container | ||
|
||
This is an openSUSE Base Container Image for DHCP server | ||
|
||
## How to use this container image | ||
|
||
The container image expects dhcp configuration file in the path /etc/kea. | ||
To run dhcp4 for the configuration provided in the directory /etc/kea | ||
|
||
```ShellSession | ||
podman container runlabel run \ | ||
{{ image.pretty_reference }} | ||
``` | ||
To run dhcp6 for the configuration provided in the directory /etc/kea | ||
|
||
```ShellSession | ||
podman container runlabel run_dhcp6 \ | ||
{{ image.pretty_reference }} | ||
``` | ||
|
||
Dhcp configuration file can also be provided in the current directory. | ||
To run dhcp4 for the configuration provided in the current directory | ||
|
||
```ShellSession | ||
podman container runlabel runcwd \ | ||
{{ image.pretty_reference }} | ||
``` | ||
To run dhcp6 for the configuration provided in the current directory | ||
|
||
```ShellSession | ||
podman container runlabel runcwd_dhcp6 \ | ||
{{ image.pretty_reference }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters