mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2025-12-30 04:52:29 +00:00
* - Use staged container builds to improve caching and reduce size
- Image size reduced from 8 GB to 1.6ish
- Switched from Make to Ninja for faster builds that do not hog processor
- Removed unneded dependencies
- Added to .dockerignore
- Readme for docker stuff
- Staged Builds
- Docker's overlay FS means that `rm`ing files does not reduce size
- Once build artifacts are build, the build dependencies are no longer needed
- Both of these can be solved by building in a temporary image and copying
only the needed libraries in
- Leverages DESTDIR to generate a directory structure that can be just
copied onto the `/` of the filesystem
- Similarly, the data files (like models) can be downloaded ahead of time
into their own image and copied in. This saves on network IO.
- Anything in a RUN directive that is non-deterministic (e.g. downloading
a file from a link, the content of that link changes) does not cause a cache
miss, so if you need to update something RUN uses, either modify the
dockerfile or build with `--no-cache` to force a rebuild
- Switch to Ninja
- cmake can generate many types of build systems
- Ninja builds faster than GNU Make
- `make -j` has a tendency to lock up my system when building locally
- Do not need to tell ninja how many jobs to run
- .dockerignore
- Paths in .dockerignore are basically invisible to dockerd, so when dockerd
zips up the build context, all of the cruft can be ignored
- it is beneficial to docker build speed to add any large, unnecssary files
and directories to .dockerignore.
- Just remember they cannot be seen by dockerd
* removing cruft and some format fixes
* updated dockerfile to opencv 4.1.0
7 lines
182 B
Bash
7 lines
182 B
Bash
## This is read by docker-compose. You can overwrite these at runtime, e.g.:
|
|
## DOCKERUSER=bobfoo docker-compose build
|
|
|
|
DOCKERUSER=openface
|
|
DOCKERTAG=latest
|
|
DATA_MOUNT=/tmp/openface
|