1 1
neomanic

Using Docker to host Armbian builds

Recommended Posts

There was recently a discussion on an issue over on github dealing with an issue that popped up when building Armbian within a Docker container.

 

Following on from there, it was decided that it would be a good idea to document the build process using Docker, and adding a howto, best practices, and FAQ to the main Armbian documentation. (I've put my hand up to coordinate this.)

 

Using Docker is a good alternative to a VM, and particularly for anyone on macOS or Windows.

 

So to kick off the thread, it'll be good just to discuss what should go into the docs. Also to see if anyone is interested in building with Docker and hasn't done so yet.

Share this post


Link to post
Share on other sites

Building using Docker should not be much different from standard setup, but we could use more testing, polishing and enhancements for the build process.

 

This includes

  • testing and providing logs for full image build to check if current workarouns for loop devices are working or need adjustments
  • enhancing Dockerfile if there are any options that may make default experience better
  • testing whether Docker implementation on Windows works fine for full image builds

Share this post


Link to post
Share on other sites

Hi, I'm new to Docker but was hoping that I could use it for building Armbian. Was the howto/FAQ ever written? My initial attempts aren't going so well :)
 

[much downloading of cross compilers]

 

[ .... ] Downloading [ gcc-linaro-7.1.1-2017.08-x86_64_arm-linux-gnueabihf ]
######################################################################## 100.0%
######################################################################## 100.0%
[ .... ] Verifying 
[ .... ] Extracting 
[ o.k. ] Download complete 

cannot open tty-output
[ error ] ERROR in function source [ main.sh:105 ]
[ error ] No option selected 
[ o.k. ] Process terminated 
 

Share this post


Link to post
Share on other sites
9 hours ago, James Kingdon said:

Hi, I'm new to Docker but was hoping that I could use it for building Armbian. Was the howto/FAQ ever written? My initial attempts aren't going so well :)

Hm. How did you run it? What is the host OS?

Docker based build should be started by running

./compile.sh docker

on the host system (you don't need to use sudo if your regular user was added to the docker group), it will pass all necessary options and should exit with an error if your version is too old

Share this post


Link to post
Share on other sites

I'm a bit confused over the version numbering in Docker - have they changed formats or are there two different projects with the same name?

 

./compile.sh docker fails and suggests using version 17.06. My docker install returns a version number of 1.12.6 with a build date of Jan 2017

 

[ .... ] Running the container 
unknown flag: --device-cgroup-rule
See 'docker run --help'.
[ warn ] Docker error [ 125 ]
[ warn ] please make sure you are using the latest version (17.06 CE or newer) 
[ warn ] please check the Armbian documentation for the Docker setup procedure 
Client:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   78d1802
 Built:        Tue Jan 31 23:35:14 2017
 OS/Arch:      linux/amd64
Server:
 Version:      1.12.6
 API version:  1.24
 Go version:   go1.6.2
 Git commit:   78d1802
 Built:        Tue Jan 31 23:35:14 2017
 OS/Arch:      linux/amd64


 

Share this post


Link to post
Share on other sites

It looks like the cgroup-rule lines are only needed for building images, so I've commented them out and passed KERNEL_ONLY=yes on the command line for now.

 

I'm still not quite understanding how to work with this environment though. How do I ensure that the state of the container is persisted after the build so that I can make a small change to the kernel source and rebuild the kernel? How do I interact with the container to edit a file?

 

Sorry for the beginner questions!

Share this post


Link to post
Share on other sites
24 minutes ago, James Kingdon said:

I'm a bit confused over the version numbering in Docker - have they changed formats or are there two different projects with the same name?

Upstream Docker has different version numbering compared to versions present i.e. in Debian/Ubuntu repositories.

Docker provides repositories for Debian and Ubuntu: https://docs.docker.com/engine/installation/  https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/

 

15 minutes ago, James Kingdon said:

I'm still not quite understanding how to work with this environment though. How do I ensure that the state of the container is persisted after the build so that I can make a small change to the kernel source and rebuild the kernel? How do I interact with the container to edit a file?

2 named volumes (armbian-cache and ambian-ccache) are used to hold all the cached data even if containers will be rebuilt.

This build procedure was not exactly designed to work with manual source changes, but you can try using "docker volume inspect armbian-cache" to get the path to cached data and change it between the runs.

Share this post


Link to post
Share on other sites

Thanks again Zador, that was enough to get me going. I did some fairly hacky things to the build scripts to force my changes (I must learn how to use the user patch system to do this properly) and have a new kernel and uboot compiled.

Share this post


Link to post
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...
1 1