Skip to content

Commit d145f2e

Browse files
anoopcs9phlogistonjohn
authored andcommitted
ad-server: Add mechanism to install RPMs from non-standard repos
We also add a special case for accepting nightly built Samba RPMs.
1 parent 50ddec4 commit d145f2e

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

images/ad-server/Containerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
FROM registry.fedoraproject.org/fedora:34
22

3-
RUN dnf install -y samba-dc procps-ng /usr/bin/smbclient
4-
RUN rm -f /etc/samba/smb.conf
3+
ARG INSTALL_PACKAGES_FROM=default
4+
ARG SAMBA_SPECIFICS=
5+
6+
COPY install-packages.sh /usr/local/bin/install-packages.sh
7+
RUN /usr/local/bin/install-packages.sh "$INSTALL_PACKAGES_FROM"
8+
59
COPY provision.sh /usr/local/bin/provision.sh
610
COPY run.sh /usr/local/bin/run.sh
711
COPY populate.sh /usr/local/bin/populate.sh

images/ad-server/install-packages.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
get_custom_repo() {
6+
url="$1"
7+
fname="$(basename "$url")"
8+
dest="/etc/yum.repos.d/${fname}"
9+
dnf install --setopt=install_weak_deps=False -y curl
10+
curl "$url" -o "$dest"
11+
}
12+
13+
install_packages_from="$1"
14+
case "${install_packages_from}" in
15+
samba-nightly)
16+
get_custom_repo "http://artifacts.ci.centos.org/samba/pkgs/master/fedora/samba-nightly-master.repo"
17+
;;
18+
custom-repo)
19+
get_custom_repo "${INSTALL_CUSTOM_REPO}"
20+
;;
21+
esac
22+
23+
dnf install --setopt=install_weak_deps=False -y \
24+
samba-dc \
25+
procps-ng \
26+
/usr/bin/smbclient
27+
dnf clean all
28+
29+
rm -rf /etc/samba/smb.conf

0 commit comments

Comments
 (0)