Limit Resource Use When Building Container Images

We’re building container images through Concourse, and one in particular, which produces a build of one of our backends in Rust, consumes too many resources and causes the worker to crash. Is there any way to limit resource use?