mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 14:42:16 +08:00
14 lines
396 B
Go
14 lines
396 B
Go
package containers
|
|
|
|
import (
|
|
"dagger.io/dagger"
|
|
)
|
|
|
|
// Sha256 returns a dagger.File which contains the sha256 for the provided file.
|
|
func Sha256(d *dagger.Client, file *dagger.File) *dagger.File {
|
|
return d.Container().From("busybox").
|
|
WithFile("/src/file", file).
|
|
WithExec([]string{"/bin/sh", "-c", "sha256sum /src/file | awk '{print $1}' > /src/file.sha256"}).
|
|
File("/src/file.sha256")
|
|
}
|