diff --git a/README.md b/README.md index 8457ecad8..39c8296e4 100644 --- a/README.md +++ b/README.md @@ -44,15 +44,57 @@ When you call `wharfie build` with the `--incremental` flag, the build process i 1. Wharfie creates a new docker container from the source image, mounting the volumes from the incremental build container 1. Wharfie bind-mounts the application source into `/usr/source` in the container -1. Wharfie runs `/usr/bin/restore-artifact` to restore the build context from the prior image -1. Wharfie calls `/usr/bin/prepare` in the container +1. Wharfie calls `/usr/bin/prepare` in the container - `prepare` detects previous artifacts and + restores them 1. Wharfie commits the container as a new image, setting the new image's command to `/usr/bin/run` -There are two more scripts to implement to support incremental builds: - -1. `save-artifact`: This script is responsible for moving build dependencies to `/usr/artifacts` -1. `restore-artifact`: This script is responsible for restoring a build environment from -`/usr/artifacts` +Note the invocation of the `save-artifacts` script; this script is responsible for moving build +dependencies to `/usr/artifacts` ### Getting started +You can start using wharfie right away by using the sample image and application sources in the +`test_sources` directory. Here's an example that builds a simple HTML app: + + docker build -rm -t fedora-mock test_sources/images/fedora-mock + wharfie build fedora-mock test_sources/applications/html --tag wharfie_app + docker run -rm -i -p -t wharfie_app + +### Validating a source image + + wharfie validate IMAGE_NAME [--supports-incremental] [--url=URL] [--timeout=TIMEOUT] [-l LOG_LEVEL] + + Arguments: + IMAGE_NAME Source image name. Wharfie will pull this image if not available locally. + + Options: + --supports-incremental Check for compatibility with incremental builds + -l LOG_LEVEL Logging level. Default: INFO + --timeout=TIMEOUT Timeout commands if they take too long. Default: 120 seconds. + --user=USERID Perform the build as specified user. + --url=URL Connect to docker at the specified url [default: unix://var/run/docker.sock] + +You can validate that an image is usable as a wharfie source image as follows: + + wharfie validate IMAGE_NAME + +Add the `--supports-incremental` option to validate the a source image supports incremental builds: + + wharfie validate IMAGE_NAME --supports-incremental + +### Building a deployable image with wharfie + + wharfie build IMAGE_NAME SOURCE_DIR [--tag=BUILD_TAG] [--incremental=PREV_BUILD] + [--user=USERID] [--url=URL] [--timeout=TIMEOUT] [-e ENV_NAME=VALUE]... [-l LOG_LEVEL] + + Arguments: + IMAGE_NAME Source image name. Wharfie will pull this image if not available locally. + SOURCE_DIR Directory containing your application sources. + + Options: + --incremental=PREV_BUILD Perform an incremental build. PREV_BUILD specified the previous built image. + -l LOG_LEVEL Logging level. Default: INFO + --tag=BUILD_TAG Tag a successful build with the provided name. + --timeout=TIMEOUT Timeout commands if they take too long. Default: 120 seconds. + --user=USERID Perform the build as specified user. + --url=URL Connect to docker at the specified url [default: unix://var/run/docker.sock]