This is a docker environment to build CEF (Chromium Embedded Framework). It builds CEF for x64 and for ARM64.
- Install Docker
- (optional) Install docker-compose
- (optional) Manage Docker as a non-root user
Note: although, docker-compose
is listed as optional above, but this file does not provide instructions for how to build CEF with docker engine only, thus docker-compose is recommended for simplicity.
Note: older versions of docker engine and docker-compose
may throw exceptions. See Troubleshooting section.
To build for ARM64:
$ cef_arch=arm64 docker-compose run --rm cef
To build for x64:
$ cef_arch=x64 docker-compose run --rm cef
The environment will:
- Build CEF artifacts
- Archive them (with 7z)
- The format of a filename of a resulting archive is
cef-chromium_git-{cef_arch}-{date}T{time}.7z
- The format of a filename of a resulting archive is
- Put them to
./cef/output
on the host OS
- It takes many hours to build CEF for x64 and even more hours to build for ARM64.
- It builds Debug and Release artifacts in one pass.
Sizes of resulting images:
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
cef x64 c0af0fb651fc 5 hours ago 61.7GB
cef arm64 2478382404a1 13 hours ago 65.1GB
Sizes of 7z artifacts:
$ ls -lh ~/code/cef-dockerized/cef/output/
total 17G
-rw-r--r-- 1 root root 5.2G Aug 9 09:42 cef-chromium_git-arm64-2020.08.09T16:14:59.7z
-rw-r--r-- 1 root root 6.2G Aug 9 17:22 cef-chromium_git-x64-2020.08.09T23:57:22.7z
Sizes of unzipped artifacts:
$ du -ch -d0 ~/tmp/cef-chromium_git-x64-2020.08.09T23\:57\:22/
31G ~/tmp/cef-chromium_git-x64-2020.08.09T23:57:22/
$ ls -lh ~/tmp/cef-chromium_git-x64-2020.08.09T23:57:22/chromium_git/chromium/src/out/Release_GN_x64/libcef.so
812M Aug 9 16:44 libcef.so
$ ls -lh ~/tmp/cef-chromium_git-x64-2020.08.09T23:57:22/chromium_git/chromium/src/out/Release_GN_x64/cefsimple
2.4M Aug 9 16:44 cefsimple
There are also all sorts of static libraries that are generated during a build
$ find ~/tmp/cef-chromium_git-x64-2020.08.09T23:57:22/chromium_git/chromium/src/out/Release_GN_x64/cefsimple -name '*.a' | wc -l
1269
Q: cef_arch=x64 docker-compose run --rm cef
raises the following error and does not build:
cef_arch=x64 docker-compose run --rm cefERROR: Invalid interpolation format for "image" option in service "cef": "cef:${cef_arch:?cef_arch [arm64,x64] docker-compose run ...}"
A: docker-compose.yml
of this project uses version: 3.8
, make sure your docker engine is of supported version 19.03.0+
and docker-compose
is latest per https://docs.docker.com/compose/compose-file/compose-versioning/. The most recent version of docker-compose
can be installed from here https://docs.docker.com/compose/install/.