Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/xcp_ng_dev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def add_common_args(parser):
group.add_argument('--disablerepo',
help='disable repositories. Same syntax as yum\'s --disablerepo parameter. '
'If both --enablerepo and --disablerepo are set, --disablerepo will be applied first')
group.add_argument('-U', '--disable-upstream-repos', action='store_true', help='disable the upstream repositories')
group.add_argument('--no-update', action='store_true',
help='do not run "yum update" on container start, use it as it was at build time')

Expand Down Expand Up @@ -170,6 +171,8 @@ def container(args):
if args.env:
for env in args.env:
docker_args += ["-e", env]
if args.disable_upstream_repos:
docker_args += ["-e", "DISABLE_UPSTREAM_REPOS=true"]
if args.enablerepo:
docker_args += ["-e", "ENABLEREPO=%s" % args.enablerepo]
if args.disablerepo:
Expand Down
2 changes: 2 additions & 0 deletions src/xcp_ng_dev/files/Dockerfile-8.x
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ARG CENTOS_VERSION
COPY files/CentOS-Vault.repo.in /etc/yum.repos.d/CentOS-Vault-7.5.repo
RUN sed -i -e "s/@CENTOS_VERSION@/${CENTOS_VERSION}/g" /etc/yum.repos.d/CentOS-Vault-7.5.repo

ENV UPSTREAM_REPOS="C${CENTOS_VERSION}-base C${CENTOS_VERSION}-updates C${CENTOS_VERSION}-extras"

# Add our repositories
# Repository file depends on the target version of XCP-ng, and is pre-processed by build.sh
ARG XCP_NG_BRANCH=8.3
Expand Down
2 changes: 2 additions & 0 deletions src/xcp_ng_dev/files/Dockerfile-9.x
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ RUN dnf update -y \
# clean package cache to avoid download errors
&& yum clean all

ENV UPSTREAM_REPOS="appstream baseos crb epel extras alma10-devel"

# enable repositories commonly required to build
RUN dnf config-manager --enable crb

Expand Down
7 changes: 7 additions & 0 deletions src/xcp_ng_dev/files/init-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ case "$OS_RELEASE" in
*) echo >&2 "ERROR: unknown release, cannot know package manager"; exit 1 ;;
esac

# disable upstream repositories if needed
if [ "$DISABLE_UPSTREAM_REPOS" == "true" ]; then
for repo in $UPSTREAM_REPOS; do
sudo $CFGMGR --disable "$repo"
done
fi

# disable repositories if needed
if [ -n "$DISABLEREPO" ]; then
sudo $CFGMGR --disable "$DISABLEREPO"
Expand Down