Commit 8c7ed6b
committed
rpm: always replace existing repo-configuration
The installation script's main purpose is to perform a fresh install, because
it's not guaranteed to work correctly when updating an existing installation,
and we print a warning if we find docker is already installed. However, it's
known that the script is used to update existing installations.
The current script has some limitations for the update scenario;
- When using the script for installing from the staging domain, the existing
repo configuration is not overwritten. When using `yum`, or older `dnf` versions
this resulted in 2 separate repo files to be created (docker-ce.repo and
docker-ce-staging.repo), which resulted in errors due to duplicate repo
definitions with the same name.
- When using `dnf5`, we specified the filename to store the configuration,
which resulted in an error;
+ sh -c 'dnf5 config-manager addrepo --save-filename=docker-ce.repo --from-repofile='\''https://download-stage.docker.com/linux/fedora/docker-ce-staging.repo'\'''
File "/etc/yum.repos.d/docker-ce.repo" already exists and configures repositories with IDs "docker-ce-stable docker-ce-stable-debuginfo docker-ce-stable-source docker-ce-test docker-ce-test-debuginfo docker-ce-test-source docker-ce-nightly docker-ce-nightly-debuginfo docker-ce-nightly-source". Add "--overwrite" to overwrite.
- On SLES, it would result in a similar error;
+ sh -c 'zypper addrepo https://download-stage.docker.com/linux/sles/docker-ce-staging.repo'
Adding repository 'Docker CE Nightly - s390x' ......................................................................................[error]
Repository named 'docker-ce-nightly' already exists. Please use another alias.
Adding repository 'Docker CE Nightly - Debuginfo s390x' ............................................................................[error]
Repository named 'docker-ce-nightly-debuginfo' already exists. Please use another alias.
This patch updates the script to overwrite / replace the existing repo config.
This brings the rpm-based installations in line with the Debian approach, which
unconditionally overwrites `/etc/apt/sources.list.d/docker.list`.
It's worth noting that this change will therefore overwrite any customisations
made to the repo-configurations, so a warning is added for that.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>1 parent 15dfae0 commit 8c7ed6b
1 file changed
Lines changed: 20 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
| |||
559 | 561 | | |
560 | 562 | | |
561 | 563 | | |
562 | | - | |
| 564 | + | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
| |||
568 | 570 | | |
569 | 571 | | |
570 | 572 | | |
| 573 | + | |
571 | 574 | | |
572 | 575 | | |
573 | 576 | | |
| |||
577 | 580 | | |
578 | 581 | | |
579 | 582 | | |
| 583 | + | |
580 | 584 | | |
581 | 585 | | |
582 | 586 | | |
| |||
659 | 663 | | |
660 | 664 | | |
661 | 665 | | |
| 666 | + | |
662 | 667 | | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
669 | 678 | | |
670 | | - | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
671 | 682 | | |
672 | | - | |
673 | | - | |
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
| |||
0 commit comments