Rust#
This guide will help you get started with a Rust project on Semaphore. If you’re new to Semaphore, we recommend reading our Guided tour first.
Hello World#
# .semaphore/semaphore.yml
version: v1.0
name: Rust example
agent:
machine:
type: e1-standard-2
containers:
- name: main
image: 'registry.semaphoreci.com/rust:1.35'
blocks:
- name: Hello world
task:
jobs:
- name: Compile and run code
commands:
- printf 'fn main() { println!("Hello World!"); }' > hello.rs && rustc hello.rs
- ./hello
Semaphore convenience images redirection
Due to the introduction of Docker Hub rate limits, if you are using a Docker-based CI/CD environment in combination with convenience images Semaphore will automatically redirect any pulls from the semaphoreci
Docker Hub repository to the Semaphore Container Registry.
Supported Rust Versions#
Semaphore supports all versions of Rust. To run Rust programs you should define a Docker-based agent using one of the available Rust images, or build your own container image that matches your needs.
For more information about pre-built Rust images provided by Semaphore, see semaphoreci/rust documentation page.