Building /e/ with Docker

I am trying to build an /e/ rom from the official tutorial:
I don’t understand step 7 at all

7. Build options

You can now customize applications installed by default in /e/OS.

  • if you want to add extra applications to the default applications: add your APK to the android_prebuilts_prebuiltapks/ directory, and set the CUSTOM_APPS environment variable accordingly in the Docker image, before building.
  • if you want to keep a minimal /e/OS build, set the MINIMAL_APPS environement variable to true…

How do I “set the CUSTOM_APPS environment variable accordingly in the Docker image”? What is an environment variable? Where do I set it?
What is happening when I run the sudo docker run command, is that already building the rom? How do I change something like brightness settings before building?
Right now it’s just “syncing branch repository”, which is already like 18GB. How long will this keep downloading? Do I have to do all that again when I want to change something and build again?

In the guide you reference all the lines starting



-e "BRANCH_NAME=<tag>" 

are setting an environment variable.

Deviations from standard docker are hard to explain (for me) without reference to old school methods.

I would highly recommend building a LineageOS build first so you see what is going on. With docker much is hidden.

You ask about space + repo sync.

The repo command is a bit like git pull plus checkout. Try looking in .repo this will contain the “clone of the remote”.

Oddly to me to start with, your " local" version starts to build outside .repo, while the

repo sync

is running.

This was not easy for me to perceive in docker even after seeing it in real time with a LineageOS build.

The whole repo sync element might be a 2 day job for my m/c, 8GB RAM, average space used 3GB per hour for 50 hours > 150 GB !

The build itself is often a further 45GB.

1 Like

If it’s 150GB, I can’t do it. My hard disk isn’t even that big. I thought roms are like 1GB. What is all that data? Is there some way to do this smaller? Can I just download the part I need for my device?

You may find this of interest :wink:
At Hetzner, a CPX51 + 512GB volume costs me less than 3€ (excl. VAT) for 24h …


The 150GB is the source code for the ROM. Building the ROM involves compiling all of that source code, so it must be present on the device you are building with. You could add an external hard drive for the source, but it will slow your build down even more. Also 150GB is pretty much the minimum. Ideally you should have more than that so you configure a big cache, which will speed up the build.

As @smu44 points out, building in the cloud is much easier, nad much, much quicker. I use OVH Public Cloud rather than Hetzner, and they currently have a ‘free trial / £50 credit’ offer. I use the fastest. most powerful server available: last time that was 120GB RAM, 32 vcores, and 400GB storage. Building from scratch on a server like that will take a few (e.g. < 10) hours, and will cost less than €10. Just remember to delete the instance when you have finished :slight_smile:

I also thing that you should try building the ‘traditional way’, starting with a build of Lineage OS for a supported device. This will help you learn what Docker is doing ‘under the bonnet’. Alternatively, try building LineageOS for microG, using their Docker image - see here for details and excellent instructions


Thanks for the responses. I’ll look into the suggestions.

I wondered, if the first command already downloads 150GB and compiles my rom, how do I do stuff like change apps? I thought there’s be like a folder I put things in that I want to be in the rom, but the procedure does not seem to allow for that.
And the main reason I want to compile a rom is that I want to change the system settings on what the lowest brightness setting is. It is way too bright on the I9195. So I’d have to somehow get into system settings.

Do I have to do another 150GB download if I compile it again?

I do not use docker, but in an old school method I found this answer helpful for a similar question:

Adding a little to this the contents of .repo are the downloaded material; one level up is the material generated by Checkout and update – so is your local copy.

Docker isn’t very helpful for doing that: it’s great for building standard ROMs but it’s not easy to customise. Much more flexible is to use this gitlab project. The README gives a ful explanation of how to use it, and the author is often to be found in these forums.

If you wanht to make more radical changes, then this github project (from the same author / developer) is great, as is its documentation.

No. the repo sync command (whether done by Docker, or by you) will juts pick up any changed files since the previous sync