Skip to content

Conversation

@menacing-american-patriot

Improving Fedora compatibility

Updated install scripts as well as server addition script in web ui to the newest dnf5 specification

Changes

- @@ -76,6 +76,8 @@ public function handle(Server $server)
                $command = $command->merge([$this->getDebianDockerInstallCommand()]);
            } elseif ($supported_os_type->contains('rhel')) {
                $command = $command->merge([$this->getRhelDockerInstallCommand()]);
            } elseif ($supported_os_type->contains('fedora')) {
                $command = $command->merge([$this->getFedoraDockerInstallCommand()]);
            } elseif ($supported_os_type->contains('sles')) {
                $command = $command->merge([$this->getSuseDockerInstallCommand()]);
            } elseif ($supported_os_type->contains('arch')) {
@@ -137,6 +139,16 @@ private function getRhelDockerInstallCommand(): string
            ')';
    }

    private function getFedoraDockerInstallCommand(): string
    {
        return "curl https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl https://get.docker.com | sh -s -- --version {$this->dockerVersion} || (".
            'dnf config-manager addrepo --from-repofile https://download.docker.com/linux/fedora/docker-ce.repo && '.
            'dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && '.
            'systemctl start docker && '.
            'systemctl enable docker --now'.
            ')';
    }

    private function getSuseDockerInstallCommand(): string
    {
        return "curl https://releases.rancher.com/install-docker/{$this->dockerVersion}.sh | sh || curl https://get.docker.com | sh -s -- --version {$this->dockerVersion} || (".
- @@ -594,7 +594,8 @@ if ! [ -x "$(command -v docker)" ]; then
    "centos" | "fedora" | "rhel")
        if [ -x "$(command -v dnf5)" ]; then
            # dnf5 is available
-            dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/$OS_TYPE/docker-ce.repo --overwrite >/dev/null 2>&1
+            dnf config-manager addrepo --from-repofile https://download.docker.com/linux/$OS_TYPE/docker-ce.repo
 --overwrite >/dev/null 2>&1
        else
            # dnf5 is not available, use dnf
            dnf config-manager --add-repo=https://download.docker.com/linux/$OS_TYPE/docker-ce.repo >/dev/null 2>&1

Issues

  • fix scripts/install.sh: I added support for fedora, and updated the dnf5 syntax from 'dnf config-manager addrepo --from-repofile=' to 'dnf config-manager addrepo --from-repofile ' in install.sh
  • fix app/Actions/Server/InstallDocker.php: Updated outdated dnf config-manager addrepo --from-repofile flag to the new dnf5 specification when adding a new server that is running fedora server OS in the web UI.

…vers

Updated outdated dnf config-manager addrepo --from-repofile flag to the new dnf5 specification when installing a new server running fedora server.
I updated the dnf5 syntax from 'dnf config-manager addrepo --from-repofile=<URL>' to 'dnf config-manager addrepo --from-repofile <URL>'
deleted duplicate 'dnf' to fix syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant