On Thu, Jul 19, 2018, 10:36 Dan Kirkwood <dang...@apache.org> wrote:

> TrafficControl uses docker-compose to build each component,  so the disk
> space used is within docker's space -- not the workspace.   We do attempt
> to clean up after each build,  but would be happy to get advice to improve
> how we're doing it.   Are there best practices others use?
>

We've been using Docker for Guacamole's Jenkins builds, as well,
autogenerating a Dockerfile which performs the actual build within a
pristine environment.

Not sure how different things would need to be with docker-compose, but we
use a combination of the "trap" command (to ensure cleanup happens
regardless of build result) and the "--no-cache" and "--rm" flags:

    # Remove image regardless of build result
    export TAG="guac-${BUILD_TAG}"
    trap "docker rmi --force $TAG || true" EXIT

    # Perform build
    docker build --no-cache=true --rm --tag "$TAG" .

- Mike

Reply via email to