[DEV] Docker template for building CyanogenMod

Search This thread

cb5264

Senior Member
Oct 10, 2012
107
71
toei.stargazer.at
I tried to run the docker image and run into a permission problem with ~/android, so
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
would bail out. Fixed this using the well known
Code:
sudo -i
to gain root and do a simple chown as a fix.
 

michael_ch

Senior Member
Oct 27, 2009
230
209

glaks

Senior Member
Jan 8, 2012
165
73
I assume this container takes ~80GB. Is it possible to trim down this download size ? Any suggestion?
 

michael_ch

Senior Member
Oct 27, 2009
230
209
The system in the container is relatively small. The huge size is caused by CyanogenMod/AOSP sources. That means, the size wouldn't be any smaller if you download & build CyanogenMod on any other host.
 

dansou901

Inactive Recognized Contributor
Apr 10, 2012
3,121
1,209
33
Aachen
OnePlus 5
OnePlus Nord
Great to have a ready-to-go docker image for building! Was just about to do one myself, but first took a look around (just didn't want to reinvent the wheel...). One thing though, it's not necessary to rsync /etc/skel to the home of cmbuild. If you call useradd with the switch -m, /home/cmbuild will get created by useradd including the copying of the skeleton files. You can even take it a step further and add your scripts like startup.sh and folders to /etc/skel before doing the useradd, then you don't need to do the permission fixing in the end (just as an idea).
EDIT: And you're missing vim in your image (just my favourite command line editor...)
 
Last edited:

michael_ch

Senior Member
Oct 27, 2009
230
209
Great to have a ready-to-go docker image for building! Was just about to do one myself, but first took a look around (just didn't want to reinvent the wheel...). One thing though, it's not necessary to rsync /etc/skel to the home of cmbuild. If you call useradd with the switch -m, /home/cmbuild will get created by useradd including the copying of the skeleton files. You can even take it a step further and add your scripts like startup.sh and folders to /etc/skel before doing the useradd, then you don't need to do the permission fixing in the end (just as an idea).
EDIT: And you're missing vim in your image (just my favourite command line editor...)
Thanks for your feedback. As far as I remember, I took the manual approach via rsync /etc/skel because someone reported an issue on hosts running Redhat Linux. Could not verify this, so I just added it. However, I'm fine with reverting that again (on Debian & Ubuntu, I would actually prefer "adduser" over "useradd").
Looking forward to your pull requests! :)

Greetings, Michael
 

dansou901

Inactive Recognized Contributor
Apr 10, 2012
3,121
1,209
33
Aachen
OnePlus 5
OnePlus Nord
Thanks for your feedback. As far as I remember, I took the manual approach via rsync /etc/skel because someone reported an issue on hosts running Redhat Linux. Could not verify this, so I just added it. However, I'm fine with reverting that again (on Debian & Ubuntu, I would actually prefer "adduser" over "useradd").
Looking forward to your pull requests! :)

Greetings, Michael

Will do some as soon as I get time for this. But wait... When using docker on another host OS, this shouldn't have an impact on creating the image as that's getting done on the base of the Ubuntu image, right? Nevertheless I can try that as well as I've got a CentOS server running here next to me...

---------- Post added at 02:53 AM ---------- Previous post was at 02:51 AM ----------

Regarding adduser / useradd: You are aware that adduser is just a wrapper around useradd, aren't you?
 
Last edited:

dansou901

Inactive Recognized Contributor
Apr 10, 2012
3,121
1,209
33
Aachen
OnePlus 5
OnePlus Nord

iesous-kurios

Senior Member
Aug 26, 2009
208
235
Spokane
iesouskurios.us
not sure what I'm missing

Trying to build 14.1 for my note 3, keep getting this message:

build@4d67d7db6d74:~/android$ breakfast hltetmo
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:245: *** Can not locate config makefile for product "cm_hltetmo". Stop.
Device hltetmo not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_samsung_hltetmo
Default revision: cm-14.1
Checking branch info
Default revision cm-14.1 not found in android_device_samsung_hltetmo. Bailing.
Branches found:
cm-11.0-old
cm-11.0
cm-12.0
cm-12.1
stable/cm-11.0
stable/cm-12.0-YNG3C
stable/cm-12.0-YNG4N
Use the ROOMSERVICE_BRANCHES environment variable to specify a list of fallback branches.
build/core/product_config.mk:245: *** Can not locate config makefile for product "cm_hltetmo". Stop.
build/core/product_config.mk:245: *** Can not locate config makefile for product "cm_hltetmo". Stop.

** Don't have a product spec for: 'cm_hltetmo'
** Do you have the right repo manifest?
 

michael_ch

Senior Member
Oct 27, 2009
230
209
Trying to build 14.1 for my note 3, keep getting this message:
Well, this won't work because apparently, nobody has created a cm-14.1 branch for your device so far:
https://github.com/CyanogenMod/android_device_samsung_hltetmo/branches
This is not an issue of the Docker image btw. The port for your device is simply missing because nobody worked on it so far.
(Actually, the link is wrong anyway because CyanogenMod has just been rebranded to "LineageOS": https://github.com/LineageOS/android_device_samsung_hltetmo/branches)
 

iesous-kurios

Senior Member
Aug 26, 2009
208
235
Spokane
iesouskurios.us
Well, this won't work because apparently, nobody has created a cm-14.1 branch for your device so far:
https://github.com/CyanogenMod/android_device_samsung_hltetmo/branches
This is not an issue of the Docker image btw. The port for your device is simply missing because nobody worked on it so far.
(Actually, the link is wrong anyway because CyanogenMod has just been rebranded to "LineageOS": https://github.com/LineageOS/android_device_samsung_hltetmo/branches)

I'm currently running a Lineage OS 14.1 ROM on my Note 3 located here:

https://xdaforums.com/galaxy-note-3/development/android-7-0-cm14-trader418-unofficial-t3459973

I was just trying to see if I could build one myself, but haven't been able to yet.
 

michael_ch

Senior Member
Oct 27, 2009
230
209
I'm currently running a Lineage OS 14.1 ROM on my Note 3 located here:

https://xdaforums.com/galaxy-note-3/development/android-7-0-cm14-trader418-unofficial-t3459973

I was just trying to see if I could build one myself, but haven't been able to yet.
Just read the post again and see that he links to a different Github repository. Also the branch name is different.
I suggest that you ask him for further build instructions. As long as you have them, it should work fine to build with this Docker image.
 
  • Like
Reactions: schasch

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    Docker template for building CyanogenMod

    Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
    Docker is a rather new software to automate the deployment of applications inside a software container.

    Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.

    NOTE: You will need to install Docker to proceed: https://www.docker.io/gettingstarted/

    How to run:
    Code:
    git clone https://github.com/stucki/docker-cyanogenmod.git
    cd docker-cyanogenmod
    ./run.sh

    How to build CyanogenMod for your device:
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
    repo sync
    source build/envsetup.sh
    brunch <device codename>      # example: brunch grouper

    Download:

    Github URL: https://github.com/stucki/docker-cyanogenmod

    ChangeLog:

    see https://github.com/stucki/docker-cyanogenmod/blob/master/CHANGELOG.md

    Questions and Answers:

    see http://xdaforums.com/android/help/qa-docker-template-building-cyanogenmod-t3173025

    Any feedback is welcome. Enjoy!
    4
    Docker template for building CyanogenMod

    Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
    Docker is a rather new software to automate the deployment of applications inside a software container.

    Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.

    How to build:
    Code:
    git clone https://github.com/stucki/docker-cyanogenmod.git
    cd docker-cyanogenmod
    ./build.sh

    How to run:
    Code:
    cd docker-cyanogenmod
    ./run.sh

    How to build CyanogenMod for your device:
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
    repo sync
    source build/envsetup.sh
    breakfast <device codename>   # example: breakfast grouper
    brunch <device codename>      # example: brunch grouper

    Download:

    Github URL: https://github.com/stucki/docker-cyanogenmod

    ChangeLog:
    Code:
    2014-02-16
    
    * Initial release

    Any feedback is welcome. Enjoy!

    seems interesting!!!!
    2
    Docker template for building CyanogenMod


    :good: nice.......
    You missed one point though .....
    Code:
    BUILD_HOST_32bit=1 (Cyanogenmod needs 32 bit binaries to compile)
    and you can incorporate this in your code
    Code:
    RUN apt-get purge openjdk-\* icedtea-\* icedtea6-\*
    RUN add-apt-repository ppa:webupd8team/java
    RUN apt-get update && sudo apt-get install oracle-java6-installer

    This installs the correct jdk for cyanogenmodand resolves the incorrect jre errors some people will get..Just my 2 cents!!..

    There is scope for expansion, I have a built a similar tool but not getting the time anymore to push new updates..:(,,,anyways keep up the good work..:)
    2
    FYI: I've pushed another update which is necessary after CyanogenMod now requires "maven" to build.
    2
    New Release v0.3.0

    Hey folks! I just published a new release of the box. Now is a good time to create your own build of the upcoming CyanogenMod 12.1:

    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b staging/cm-12.1
    repo sync -j 16
    source build/envsetup.sh
    make clean
    brunch <device codename>      # example: brunch grouper

    Have fun!