Skip to content

Commit a303aba

Browse files
authored
Merge pull request #41 from xcp-ng/no-update
Add a --no-update flag to disable the "yum update" call
2 parents 1653a82 + df11ebe commit a303aba

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/xcp_ng_dev/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ def add_common_args(parser):
5656
parser.add_argument('--disablerepo',
5757
help='disable repositories. Same syntax as yum\'s --disablerepo parameter. '
5858
'If both --enablerepo and --disablerepo are set, --disablerepo will be applied first')
59+
parser.add_argument('--no-update', action='store_true',
60+
help='do not run "yum update" on container start, use it as it was at build time')
5961

6062
def add_container_args(parser):
6163
parser.add_argument('-v', '--volume', action='append',
@@ -204,6 +206,9 @@ def container(args):
204206
docker_args += ["-e", "ENABLEREPO=%s" % args.enablerepo]
205207
if args.disablerepo:
206208
docker_args += ["-e", "DISABLEREPO=%s" % args.disablerepo]
209+
if args.no_update:
210+
docker_args += ["-e", "NOUPDATE=1"]
211+
207212
ulimit_nofile = False
208213
if args.ulimit:
209214
for ulimit in args.ulimit:

src/xcp_ng_dev/files/init-container.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ if [ -n "$ENABLEREPO" ]; then
5454
sudo $CFGMGR --enable "$ENABLEREPO"
5555
fi
5656

57-
# update to either install newer updates or to take packages from added repos into account
58-
sudo $DNF update -y --disablerepo=epel
57+
if [ -z "$NOUPDATE" ]; then
58+
# update to either install newer updates or to take packages from added repos into account
59+
sudo $DNF update -y --disablerepo=epel
60+
fi
5961

6062
cd "$HOME"
6163

0 commit comments

Comments
 (0)