Chapter 4. Container images with Rust Toolset
Rust Toolset is available as container images for RHEL 7 and RHEL 8. It can be downloaded from the Red Hat Container Registry.
4.1. Image contents
The RHEL 7 and RHEL 8 container images provide content corresponding to the following package:
Component | Version | Package |
---|---|---|
| 1.43.0 |
|
4.2. Accessing the images
To pull the image, run the following command as root:
# podman pull registry.redhat.io/devtools/rust-toolset-rhel7
# podman pull registry.redhat.io/rhel8/rust-toolset
4.3. Using as builder images with Source-to-Image
Rust Toolset container image is prepared for use as a Source-to-Image (S2I) builder image.
Example 4.1. Building a Rust application image using Source-to-Image
To build the rust-test-app from its GitHub repository, complete the following steps.
Prerequisites
- Run the following commands to prepare the builder image:
$ git clone https://github.com/openshift-s2i/s2i-rust.git $ cd s2i-rust $ make build
Procedure
Use the s2i
tool to build the rust-test-app by running the following command:
s2i build ./examples/test-app/ devtools/rust-toolset-rhel7 rust-test-app
To run the image, type the following into the command line:
$ docker run rust-test-app
A locally available application image rust-test-app is built using the rust-toolset container image.
To fully leverage the Rust as a S2I builder image, build custom images based on it, with modified S2I assemble scripts and further modifications to accomodate the particular application being built.
A detailed description of the Rust usage with Source-to-Image is beyond the scope of this document. For more information about Source-to-Image, see:
- OpenShift Container Platform 4.5 Image Creation Guide, OpenShift Container Platform-specific guidelines
- Using Red Hat Software Collections Container Images, Chapter 2. Using Source-to-Image (S2I).
4.4. Additional resources
- Rust 1.43.0 container images — entries in the Red Hat Container Registry
- Using Red Hat Software Collections Container Images