neomanic Posted November 3, 2016 Posted November 3, 2016 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.
zador.blood.stained Posted November 3, 2016 Posted November 3, 2016 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 2
James Kingdon Posted September 2, 2017 Posted September 2, 2017 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
zador.blood.stained Posted September 3, 2017 Posted September 3, 2017 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
James Kingdon Posted September 3, 2017 Posted September 3, 2017 Ah, I ran "docker build ./" in the armbian build directory and "docker run <imageid>" to invoke. I'm hosting on Linux mint 18.2 sonya on 64bit x86. Thanks for the info, I'll try again.
James Kingdon Posted September 4, 2017 Posted September 4, 2017 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
James Kingdon Posted September 4, 2017 Posted September 4, 2017 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!
zador.blood.stained Posted September 4, 2017 Posted September 4, 2017 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.
James Kingdon Posted September 4, 2017 Posted September 4, 2017 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.
Recommended Posts