-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathrhel98-bootc-crel-optionals.containerfile
More file actions
40 lines (37 loc) · 1.87 KB
/
rhel98-bootc-crel-optionals.containerfile
File metadata and controls
40 lines (37 loc) · 1.87 KB
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
# {{- if env.Getenv "CURRENT_RELEASE_VERSION" "" -}}
# Note: This comment makes templating add a new line before the code
FROM localhost/rhel98-test-agent:latest
# Copy repository configuration
COPY ./bootc-images/microshift-fast-datapath-rhel9.repo ./bootc-images/microshift-crel.repo ./bootc-images/microshift-rhocp-y.repo \
/etc/yum.repos.d/
# Print repository configuration contents.
# Install MicroShift with optional components and cleanup.
RUN dnf repoinfo --enabled && \
dnf install -y firewalld \
{{ range (env.Getenv "MICROSHIFT_MANDATORY_RPMS" | strings.Split " ") -}}
"{{ . }}-{{ env.Getenv "CURRENT_RELEASE_VERSION" }}" \
{{ end -}}
{{ range (env.Getenv "MICROSHIFT_OPTIONAL_RPMS" | strings.Split " ") -}}
"{{ . }}-{{ env.Getenv "CURRENT_RELEASE_VERSION" }}" \
{{ end -}}
{{ if and (env.Getenv "UNAME_M" "") (eq "x86_64" .Env.UNAME_M) -}}
{{ range (env.Getenv "MICROSHIFT_X86_64_RPMS" | strings.Split " ") -}}
"{{ . }}-{{ env.Getenv "CURRENT_RELEASE_VERSION" }}" \
{{ end -}}
{{ end -}}
&& \
systemctl enable microshift && \
rm -vf /etc/yum.repos.d/microshift-*.repo && \
dnf clean all
# Configure firewall
RUN firewall-offline-cmd --zone=public --add-port=22/tcp && \
firewall-offline-cmd --zone=trusted --add-source=10.42.0.0/16 && \
firewall-offline-cmd --zone=trusted --add-source=169.254.169.1 && \
firewall-offline-cmd --zone=trusted --add-source=fd01::/48 && \
firewall-offline-cmd --zone=public --add-port=80/tcp && \
firewall-offline-cmd --zone=public --add-port=443/tcp && \
firewall-offline-cmd --zone=public --add-port=5353/udp && \
firewall-offline-cmd --zone=public --add-port=6443/tcp && \
firewall-offline-cmd --zone=public --add-port=30000-32767/tcp && \
firewall-offline-cmd --zone=public --add-port=30000-32767/udp
# {{- end -}}