8 8
MathiasRenner

tutorial Docker on armbian!

Recommended Posts

Regarding swap I also noticed oom-killer behaviour but gave up even thinking about since our hope was mainline kernel all the time to be able to drop this smelly Android kernel we're dealing with on H3 boards rather sooner than later :)

Do you have (or remember) a quick and reliable way to reproduce OOM problem?

Share this post


Link to post
Share on other sites

Do you remember which cpufreq governor the loboris image used? In case it was performance then you fried your H3 all the time at 1.5V (which is exactly 0.1V above maximum voltage according to H3's data sheet).

 

Regarding swap I also noticed oom-killer behaviour but gave up even thinking about since our hope was mainline kernel all the time to be able to drop this smelly Android kernel we're dealing with on H3 boards rather sooner than later :)

 

I'm not sure about the governor, but checking his github, it looks like he only used high clockspeed with high voltages:

https://github.com/loboris/OrangePI-Kernel/blob/master/build/orange_pi_pc.fex#L1133-L1173

 

Do you know about any way to check the voltage in real-time?

Like /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq for current frequency and /sys/class/thermal/thermal_zone0/temp for temperature.

 

Do you have (or remember) a quick and reliable way to reproduce OOM problem?

 

Try

stress -m 4

it will try to reserve 1GB of memory.

Your system will become unresponsive until the oom-killer kills the stress' processes.

Share this post


Link to post
Share on other sites

Okay, it's been a while.

Since my last post, I've tried everything, from different voltages to different HDD, I also ordered an uart dongle which arrived today and maybe got a lead on the root-cause of the issue:

 

Here is the console output during a kernel crash:

https://gist.github.com/anonymous/0c2c09d52dd66b302347bc6527969070

 

The code it mentions can be see here:
https://github.com/megous/linux/blob/orange-pi-4.7/net/core/dev.c#L2471

 

Sadly, I'm not knowledgeable enough to put the picture together, but if somebody can (and hopefully fix it), it is you.

I'd be grateful if you could take a look at this and I'd be glad to help in any way.

Thank you.

Share this post


Link to post
Share on other sites

Hi guys,

 

What do you do about storage? Do you have a huge SD? I use a NAS, and I'm having problems with NFS and docker, seems the later doesn't like NFS at all. How do you use large quantities of storage with the limitations of the SD?

 

Thanks!

Share this post


Link to post
Share on other sites

timonoj, how many containers are you running? And what kind of applications inside them? I've 7 applications running now and my current disk usage is ~2.7G. (this is everything: Armbian+images+containers+container data)

Share this post


Link to post
Share on other sites

At this moment zero, since I was doing a brand new install. During testing I tried a beta app that takes some 2.5GB on its own due to lack of dependencies polishing I think (Open365). Also Seafile deals with a huge amount of storage, but that one is happily taking a NFS mount point. Problem is, it's not very portable should I change the hardware or configuration on the OS (or OS completely, for that matter). I was thinking it to port it to a docker, but then again I'm facing the same trouble. Plus, any of these working on an SD would imply serious I/O whenever dealing with big chunks of files...I wouldn't trust it to keep the important data, just the system files. I'd prefer to even store the docker containers somewhere else. Safer.

 

EDIT: Do you guys think it would be possible to mount EVERYTHING on a iSCSI target? Even the OS and boot from it? It would make snapshotting the whole OS a piece of cake.

Share this post


Link to post
Share on other sites

I don't think u-boot can boot from iscsi as it is a relatively complex protocol, but it can boot with PXE, so you might be able to boot Armbian from a iPXE server.

 

When I said "container data" in my previous comment, I meant the application's config/cache/etc. The large files are on an usb-attached hdd. If your board has on-board sata, you could use that.

Share this post


Link to post
Share on other sites

Thanks, I might consider booting from PXE...Although that is way more complicated to setup I think, and messier to maintain. And the additional HDD...Sure that's an option, but I'd like to avoid having to purchase another HDD since I already have a NAS (hence my interest in iSCSI, the NAS sets those in almost just two clicks).

Share this post


Link to post
Share on other sites

I'm not too much familiar with Open365, never used it, but after glancing at its docker-compose file, you should be able to mount any of the hosts directory to any of the containers.

So, if you can mount a remote filesystem on your host, (and you can definitely mount iscsi and nfs on Armbian), you could use that inside your containers as a volume.

Share this post


Link to post
Share on other sites

Sure...but not the container itself, which goes to the SD regardless what you might want. I tried linking the folder to a NAS mount, but it doesn't like that.

Share this post


Link to post
Share on other sites

If you mount the remote filesystem under /var/lib/docker than everything docker-related (images,containers,networks,etc) will be on your NAS.

Share this post


Link to post
Share on other sites

Yup, did that :D

Unsupported by docker, and crashes. It didn't like it. Apparently NFS is not in their plans yet.

 

EDID: Well apparently some dude managed to do it by modifying a bunch of things...here.

https://whyistheinternetbroken.wordpress.com/2015/05/12/techusing-nfs-with-docker-where-does-it-fit-in/

 

I might have to try that path, but it doesn't look like a piece of cake. At least all the nfs shares and client and autofs mounts are already there...

Share this post


Link to post
Share on other sites

Hmm...You mean only for the docker containers? I can try to see if it takes a iSCSI partition as the mount point for /var/lib/docker...Worth a shot.

 

Thanks!

Share this post


Link to post
Share on other sites

I just bough an Orange Pi PC2 and would love to see Docker running on it.

 

End of Q2 / 2017 in most optimistic scenario with mainline kernel, while you can try luck with stock Allwinner SDK. It should be possible to bring Docker to that kernel, while it's not recommended.

 

H3, which is around for some time, is also not quite production ready with mainline, but Docker is working ...

Share this post


Link to post
Share on other sites

Hi, I don't know if is relevant but If anyone can check that command works like me,

 

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

to install docker says:

echo "deb https://packagecloud.io/Hypriot/Schatzkiste/debian/ wheezy main" > /etc/apt/sources.list.d/hypriot.list
curl https://packagecloud.io/gpg.key | sudo apt-key add -
apt-get update
apt-get -y install --no-install-recommends docker-hypriot
apt-get -y install cgroupfs-mount
reboot

and works well, but I if we use jessie, that source file with wheezy i'm not sure that is correct.

 

but, I've been able to install and run docker with this new method in my cubieboard with mainline kernel (other devices I think too) and I think that is the way to install docker now?

curl -sSL https://get.docker.com | sh

this update sources, and install docker (now version 1.13 for arm)

 

and if user would work docker with user permissions , next we can do:

sudo usermod -aG docker myUSERNAME

if anyone can check that works like me.

we can update docs or I can send a pull request to docs.lib if I'm correct adding this method also.

 

thanks.

Share this post


Link to post
Share on other sites

Hi,

sorry for my newbie question. What version of Armbian should I use for my Orange PI Lite if I want to use it with Docker (Debian or Ubuntu and what kernel)?

After installing Docker on that board can I use Ubuntu 16.04 docker image? 

Fo my purpose I want to use Ubuntu with Swift runtime 

 

Thanks

Share this post


Link to post
Share on other sites

Hi,

sorry for my newbie question. What version of Armbian should I use for my Orange PI Lite if I want to use it with Docker (Debian or Ubuntu and what kernel)?

After installing Docker on that board can I use Ubuntu 16.04 docker image? 

Fo my purpose I want to use Ubuntu with Swift runtime 

 

Thanks

 

The one where kernel is higher than 3.10 ... which in this case means only Ubuntu experimental nightly builds. You can found it at download page ... but development versions are unfinished product meant for testing purposes only and certainly not for newbies. We don't provide any help for them.

Share this post


Link to post
Share on other sites

krystian,  in https://docs.armbian.com/User-Guide_Advanced-Features/#how-to-run-docker you can see what requirements and is what Igor says.

 

The one where kernel is higher than 3.10 ... which in this case means only Ubuntu experimental nightly builds. You can found it at download page ... but development versions are unfinished product meant for testing purposes only and certainly not for newbies. We don't provide any help for them.

 

I only tried with mainline debian jessie and works well for my proposes. , can you check my command for install if works in your device?

"curl -sSL https://get.docker.com | sh"

 

 

Hi,

sorry for my newbie question. What version of Armbian should I use for my Orange PI Lite if I want to use it with Docker (Debian or Ubuntu and what kernel)?

After installing Docker on that board can I use Ubuntu 16.04 docker image? 

Fo my purpose I want to use Ubuntu with Swift runtime 

 

Thanks

 

yes, you can have a debian jessie in orange pi and run a ubuntu 16.04 docker image, but you have to find a working image that works with arm.

 

here wou can find images that can work in arm devices.

https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=armhf&starCount=0

 

or search in docker hub for  a "ubuntu armhf" image and find if is a documentated dockerfile and check if exists the  source of this generated image , bitbucket or github to check if is correct and no malware or not a base image.

https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=ubuntu+armhf&starCount=0
 

Share this post


Link to post
Share on other sites

So looks like Docker cannot yet be run on H3 based Orange Pis (PC Plus, Lite) with default desktop Jessie builds?

 

Any update on when might above be possible?

Will support only be for Jessie and not Ubuntu defaults ?

Share this post


Link to post
Share on other sites
18 minutes ago, shippy said:

So looks like Docker cannot yet be run on H3 based Orange Pis (PC Plus, Lite) with default desktop Jessie builds?


Kernel 3.4, which you find in Allwinner default kernel, is too old for Docker - 3.10 is general minimum. You need to use (development) mainline kernel. (4.11.x at the moment)

Share this post


Link to post
Share on other sites
Just now, Igor said:


Kernel 3.4 is too old for Docker - 3.10 is general minimum. You need to use (development) mainline kernel 4.11.x at the moment.

OK. But seems like mainline is not good with WiFi or desktop?

Share this post


Link to post
Share on other sites
1 minute ago, shippy said:

OK. But seems like mainline is not good with WiFi or desktop?


It depend from the board. Some has good and already working WiFi, some shitty or not yet done. Desktop works, but no video acceleration or 3D MALI drivers.

Share this post


Link to post
Share on other sites
Just now, Igor said:


It depend from the board. Some has good WiFi, some shitty or not yet done. Desktop  works, but no video acceleration or 3D MALI drivers.

So is Orange PI Lite good with WiFi and otherwise in mainline?

Can I run media players like OMX, VLC, Kodi etc without 3D acceleration to get 720/1080p video streaming? 

Share this post


Link to post
Share on other sites
28 minutes ago, shippy said:

Can I run media players like OMX, VLC, Kodi etc without 3D acceleration to get 720/1080p video streaming? 


No video acceleration means video is barely usable, which means: no OMX, VLC or Kodi. Whenever you think on playing videos, stick to legacy and forget about Docker at the same time. WiFi on Lite is operational, while in general mainline support for H3 boards is not yet on desired level / finished. Keep that in mind.

Share this post


Link to post
Share on other sites

nice step by step docker install in this article on scaleway.com

successful installed on my Friendlyarm Nanopi M4 with 4GB ram, latest Armbian as of aug2019.

step 4 pre reqs were all there already and up to date.

step 6 see the note on arm64.

i run postgresql, nodered and grafana containers.

happy docking

Share this post


Link to post
Share on other sites
8 8