rwx image build
Launch a targeted RWX run and pull its result as an OCI image
Usage
rwx image build --target [flags]
Description
The build command launches a targeted RWX run, waits for it to complete, and pulls the resulting container image to your local Docker daemon. This allows you to build container images on RWX and immediately use them locally.
See the guide on building container images for high-level concepts and the reference docs on building images for syntax details.
Examples
Build an image from a task defined in .rwx/build.yml:
rwx image build .rwx/build.yml --target app
Build with initialization parameters and tag the result:
rwx image build .rwx/build.yml --target app \
--init version=1.2.3 \
--tag myapp:latest \
--tag myapp:1.2.3
Build without pulling the image (just run the build):
rwx image build .rwx/build.yml --target app --no-pull
Build and push to a registry in one command:
rwx image build .rwx/build.yml --target app \
--push-to registry.example.com/myapp:latest
Build and push to multiple registries:
rwx image build .rwx/build.yml --target app \
--push-to registry.example.com/myapp:latest \
--push-to registry.example.com/myapp:v1.2.3
Arguments
<file>
(required) The path to the RWX config file that defines your container image build.
Options
--target <task-key>
(required) The task key to build. This task's filesystem will be used as the container image.
-d, --dir <definitions-directory>
The directory your RWX configuration files are located in, typically .rwx. By default, the CLI traverses up until it finds a .rwx directory.
--init <key=value>
Initialization parameters for the run, available in the init context. Can be specified multiple times.
--no-cache
Do not read or write to the RWX cache during the build.
--no-pull
Do not pull the image after building. The build will run on RWX, but the resulting image will not be pulled to your local Docker daemon. Cannot be used with --tag.
--push-to <reference>
Push the built image to the specified OCI reference (registry location). This combines building and pushing into a single command. Can be specified multiple times to push to multiple registries.
This flag behaves identically to the --to flag on rwx image push, allowing you to build and push in one step instead of running two separate commands.
Example:
rwx image build .rwx/build.yml --target app \
--push-to registry.example.com/myapp:latest \
--push-to registry.example.com/myapp:v1.2.3
--tag <tag>
Tag the built image with the specified tag in your local Docker daemon. Can be specified multiple times to add multiple tags. Cannot be used with --no-pull.
Example:
rwx image build .rwx/build.yml --target app --tag myapp:latest --tag myapp:v1.0
--timeout <duration>
Timeout for waiting for the build to complete and image to pull. Default: 30m (30 minutes).