Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR-1142 - refactor install_docker to be based on the family #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jfcabral
Copy link

Hi

Motivation
This PR was initially motivated by the issue https://armbian.atlassian.net/browse/AR-1142

Upon checking the code, I've noticed it was not exactly as mentioned in the issue

echo "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian buster stable" >\

Still, I believe there was yet room for improvement, thus this PR πŸ˜„

After reviewing the install_docker function, I've noticed that it is still tied to specific Debian/Ubuntu versions. In my opinion this is not desired, as will require further maintenance in the future, in order to support newer linux versions.


Changes

  1. I've changed the logic of the referred function so it works based on the linux family, thus following the official docker install guidelines. This will, hopefully, ensure that it will be able to install Docker against any current AND future Debian/Ubuntu versions, without any further changes
  2. I've restructured the function code in order to remove some duplicated statements

Tests

Installation of Docker, using the tool on a freshly installed:

  • βœ… Ubuntu 22.04.1 (jammy)
  • βœ… Ubuntu 18.04.5 (bionic) - proving it is not only forward compatible, but also backwards compatible πŸ˜„

Note: In order to speed-up the test process, I've done both tests using WSL2 on Windows 10 (AMD64). I know it's not ideal, but I believe the code, as is, should be independent from the HW architecture.


If you have any question, feedback or suggestion, please do not hesitate to say so :)
Thank you

@iav
Copy link
Contributor

iav commented Dec 30, 2022

I remember there was an idea "use docker from the default repository for latest releases".
But, maybe, there no need for aptly menu for just apt install docker, and this proposal is a right thing?

@jfcabral
Copy link
Author

jfcabral commented Jan 1, 2023

Hi @iav, thank you for your feedback!

From my experience, as far as Ubuntu is concerned, you can't simply do an apt-get to install it. Even on the latest LTS version (22.04.1 LTS)

If you were to try to install it, without previously configuring the Docker repository, you'd get this:

# sudo apt-get update was executed right before
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'docker-ce' has no installation candidate
E: Unable to locate package docker-ce-cli
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-compose-plugin

tested on a fresh install of Ubuntu 22.04.1 LTS using WSL2 on Windows 10.

So, as far as I know, the "best" way to install docker on Debian/Ubuntu, is by following the official install notes:

which involves setting up the repository.

There's also the possibility of using an official convenience script: https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script but since the repository strategy was already implemented, I've decided to stick to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants