<commit_before>#!/bin/bash
set -e

bucket="${1:-get.docker.com}"

current="$(curl -fsSL "https://${bucket}/latest")"
sha256="$(curl -fsSL "http://${bucket}/builds/Linux/x86_64/docker-${current}.sha256" | cut -d' ' -f1)"

# "tac|tac" for http://stackoverflow.com/a/28879552/433558
dindLatest="$(curl -sSL 'https://github.com/docker/docker/commits/master/hack/dind.atom'| tac|tac | awk -F '[[:space:]]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')"

(
	set -x

	sed -ri '
		s/^(ENV DOCKER_BUCKET) .*/\1 '"$bucket"'/;
		s/^(ENV DOCKER_VERSION) .*/\1 '"$current"'/;
		s/^(ENV DOCKER_SHA256) .*/\1 '"$sha256"'/;

		s/^(ENV DIND_COMMIT) .*/\1 '"$dindLatest"'/;
	' {,dind/}Dockerfile
)<commit_msg>Fix update.sh to also update FROM docker:...<commit_after>#!/bin/bash
set -e

bucket="${1:-get.docker.com}"

current="$(curl -fsSL "https://${bucket}/latest")"
sha256="$(curl -fsSL "http://${bucket}/builds/Linux/x86_64/docker-${current}.sha256" | cut -d' ' -f1)"

# "tac|tac" for http://stackoverflow.com/a/28879552/433558
dindLatest="$(curl -sSL 'https://github.com/docker/docker/commits/master/hack/dind.atom'| tac|tac | awk -F '[[:space:]]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')"

(
	set -x

	sed -ri '
		s/^(ENV DOCKER_BUCKET) .*/\1 '"$bucket"'/;
		s/^(ENV DOCKER_VERSION) .*/\1 '"$current"'/;
		s/^(ENV DOCKER_SHA256) .*/\1 '"$sha256"'/;

		s/^(FROM docker):.*/\1:'"$current"'/;
		s/^(ENV DIND_COMMIT) .*/\1 '"$dindLatest"'/;
	' {,dind/}Dockerfile
)
{'fraction_non_alphanumeric': 0.2861016949152542, 'fraction_numerical': 0.05355932203389831, 'mean_word_length': 3.761290322580645, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1612315', 'n_tokens_mistral': 751, 'n_tokens_neox': 659, 'n_words': 110}