Jump to content

Docker on armbian!


Recommended Posts

Few simple steps to install docker and docker compose on clean Armbian_20.05.4_Odroidxu4_focal_current_5.4.41 ODROID-HC1

Thanks to official docs https://docs.docker.com/engine/install/ubuntu/

 

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -

    # Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88 - you may skip this

    apt-key fingerprint 0EBFCD88

    # add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

    add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu bionic stable" # there is no repository for focal :(

    apt-get update

    apt-get install docker-ce docker-ce-cli containerd.io

    docker run --rm hello-world # test - you may skip

    docker --version

 

    apt install python3-pip

    apt install python3-dev

    apt install libffi-dev

    apt install libssl-dev

    pip3 install docker-compose

    docker-compose --version

 

That's all, enjoy

Sorry for necroposting

Link to comment
Share on other sites

As the documentation is now marked as obsolete, what is the correct way to install Docker on a recent Armbian Buster?

  ___                             ____  _   _  _
 / _ \ _ __ __ _ _ __   __ _  ___|  _ \(_) | || |
| | | | '__/ _` | '_ \ / _` |/ _ \ |_) | | | || |_
| |_| | | | (_| | | | | (_| |  __/  __/| | |__   _|
 \___/|_|  \__,_|_| |_|\__, |\___|_|   |_|    |_|
                       |___/
Welcome to Armbian 20.08.17 Buster with Linux 5.8.17-rockchip64

 

I think at one time, it was available in armbian-config, but I may be wrong.. And I'm trying that on an unsupported board (OrangePi4).

Here is what I have done:

sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo docker run hello-world


Thanks.

Link to comment
Share on other sites

the distro natively packaged versions are new enough for my use these days.. I just do apt install docker.io

Link to comment
Share on other sites

Thanks for the tip.

I will try it on another machine with a fresh install, as I get :

apt install docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 docker.io : Depends: runc (>= 1.0.0~rc6~)
E: Unable to correct problems, you have held broken packages.

 

Link to comment
Share on other sites

Hi. I am attempting to install  docker and I've hit a snag in the installation. I followed the instructions here: https://docs.docker.com/engine/install/ubuntu/

 

For some reason the docker service did not start. Here is the error from installation and the systemctl status:

 


Setting up docker-ce (5:20.10.18~3-0~ubuntu-jammy) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2022-10-10 19:40:40 EDT; 39ms ago
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
    Process: 15936 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 15936 (code=exited, status=1/FAILURE)
        CPU: 367ms
dpkg: error processing package docker-ce (--configure):
 installed docker-ce package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
 docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)


admin@lepotato:~$ sudo systemctl status docker.service
× docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2022-10-10 19:40:49 EDT; 2min 0s ago
TriggeredBy: × docker.socket
       Docs: https://docs.docker.com
    Process: 16057 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
   Main PID: 16057 (code=exited, status=1/FAILURE)
        CPU: 473ms

Oct 10 19:40:49 lepotato systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Oct 10 19:40:49 lepotato systemd[1]: Stopped Docker Application Container Engine.
Oct 10 19:40:49 lepotato systemd[1]: docker.service: Start request repeated too quickly.
Oct 10 19:40:49 lepotato systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 10 19:40:49 lepotato systemd[1]: Failed to start Docker Application Container Engine.

 

Link to comment
Share on other sites

I have the same issue than ajkelsey with installation of Docker on an Orange Pi zero2 under Armbian_23.02.3_Orangepizero2_bullseye_legacy_4.9.318.

 

I tried the two methods described in the official documentation (https://docs.armbian.com/User-Guide_Advanced-Features/#how-to-run-docker), but the docker service refuses to load.

 

Is there anything I'm missing? I was planning to try it on a fresh Armbian installation. I did not try to install Docker on Jammy and Bookworm because wifi does not work properly with these systems (available at https://www.armbian.com/orange-pi-zero-2/)

Link to comment
Share on other sites

22 minutes ago, Alligator427 said:

Is there anything I'm missing?

Docker needs some kernel stuff that has been introduced after 4.9.y was released. So the only way is to run a more recent kernel which probably does not support all hw features the board has to offer.

Link to comment
Share on other sites

Thanks, Werner!

The official Armbian documentation states that the version should be 20.08.17 or newer, with Kernel 3.10 or higher.

I thought I was in the clear with Armbian_23.02.3_Orangepizero2_bullseye_legacy_4.9.318.

https://docs.armbian.com/User-Guide_Advanced-Features/#how-to-run-docker

Perhaps this requirement applies to an older version of Docker. I'm considering trying a 1-2-year-old version of Docker to see if it works. Not sure if it makes sense.

 

I've attempted to install three different versions of Bullseye (edge and current) with a kernel >4.9 (5.15.x or 6.2), but none of them boot up on the Orange Pi Zero 2. Unfortunately, The only versions that boot up have kernel 4.9.

https://www.armbian.com/orange-pi-zero-2/

Edited by Alligator427
Link to comment
Share on other sites

docs are most likely behind due to lack of maintenance (feel free to contribute!).

Docker wants cgroupsv2 which have been introduced in kernel 4.15.y

4.9.y is vendor kernel which might work better but is outdated and unmaintained:https://docs.armbian.com/User-Guide_FAQ/#why-does-hardware-feature-xy-work-in-old-kernel-but-not-in-more-recent-one

Link to comment
Share on other sites

The only solution for legacy images is to downgrade to cgroups v1 with kernel parameter 

 

You add this in armbianEnv.txt

 

extraargs=systemd.unified_cgroup_hierarchy=0

 

 

To use cgroup v2, you need to have kernel 4.15 or later https://github.com/opencontainers/runc/blob/v1.0.0-rc95/docs/cgroup-v2.md#host-requirements.

 

Other requirements you might need to set iptables debian os

 

The docker installer uses iptables for nat. Unfortunately Debian uses nftables. 
You can convert the entries over to nftables or just setup Debian to use the legacy iptables.

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

 

 

As for non booting zero2 images please check latest, builds are working fine for me at this point, although I will check, (limited time atm, also 'not sure about mirrors synching').

Link to comment
Share on other sites

Wow! Thanks ALIGMSTEN! This solve the issue completely. The last docker version is now working on Armbian bullseye kernel 4.9 on Orange pi zero2.

Thanks for your help and for what you are doing!

Here is the detailed procedure for the people that may experience the same issue.

 

-Fresh install of Armbian_23.02.3_Orangepizero2_bullseye_legacy_4.9.318.img.xz

http://xogium.performanceservers.nl/archive/orangepizero2/archive/Armbian_23.02.3_Orangepizero2_bullseye_legacy_4.9.318.img.xz

 

sudo apt-get update

sudo apt-get upgrade

 

-add the following to /boot/armbianEnv.txt

extraargs=systemd.unified_cgroup_hierarchy=0

 

-return to prompt

sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy

 

-reboot

 

-install docker according to https://docs.docker.com/engine/install/debian/ (below)

sudo apt-get update

sudo apt-get install ca-certificates curl gnupg

sudo install -m 0755 -d /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

sudo chmod a+r /etc/apt/keyrings/docker.gpg

 

-Then

echo \

  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \

  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \

  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

 

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

sudo reboot

 

-Test docker with

sudo docker run hello-world

 

Edited by Alligator427
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines