ypiguet-epfl / aseba-build-docker

0 stars 0 forks source link

Don't clone Aseba if already in WORKDIR #3

Open davidjsherman opened 6 years ago

davidjsherman commented 6 years ago

A common use for build containers is to build a version that is already checked out, and do so in the host directory so that the results are immediately available. Since the contents of the container are not needed, one would use an ephemeral container that acts as a single command, such as:

docker run -it --rm -v$PWD:/aseba deb

This would compile the current source code in a controlled environment, leave the .deb file in the host directory, and discard the container.

If it were desirable to keep the object files, one could reserve an environment variable for the build directory, permitting:

docker run -it --rm -v$PWD:/aseba -e BUILD=./build deb

Proposed changes to build.sh:

Without -v ou -e arguments, the container will continue the previous behavior, cloning a fresh copy of the Aseba source code in /aseba and building in there.