testcontainers/testcontainers-rs

Support specifying images using sha256 digests

Open

#411 opened on Oct 15, 2022

View on GitHub
 (12 comments) (1 reaction) (0 assignees)Rust (194 forks)auto 404
good first issuehelp wanted

Repository metrics

Stars
 (1,098 stars)
PR merge metrics
 (PR metrics pending)

Description

You can run docker images by specifying the sha256 digest of the designated image instead of using a specific version.

Using sha256 is somewhat more secure as it pins the exact image, thus not allowing possible overriding of a tag by a malicious actor.

Usage can be something along:

impl Image for SomeImage {
    type Args = ();

    fn name(&self) -> String {
        "some name"
    }

    fn sha256(&self) -> String {
       "a826cb8a6a0023..."
    }
}

Contributor guide