testcontainers/testcontainers-rs

Support specifying images using sha256 digests

Open

#411 aperta il 15 ott 2022

Vedi su GitHub
 (12 commenti) (1 reazione) (0 assegnatari)Rust (194 fork)auto 404
good first issuehelp wanted

Metriche repository

Star
 (1098 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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..."
    }
}

Guida contributor