docker Copy Url and then Verify CheckSum
example from Dockerfile
- name: Download Otel Collector package ansible.builtin.get_url: url: https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.88.0/otelcol_0.88.0_linux_amd64.deb dest: /tmp/otelcol_0.88.0_linux_amd64.deb mode: '0644' checksum: ”sha256:210ea7f7587d3f259db8b92f4d51f77384ca0300cd2f8abdd4cd712bf2822ed1”
example bash function
download() { # Download func() that confirms checksum. echo " ... download($# param) to $2 and verify checksum" curl -s -L $1 | tee $2 | sha256sum -c <(echo "$3 -") || rm -f $2 } download $url $filename $checksum20220725