Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New subcommands #25

Open
nicholasdille opened this issue Aug 4, 2023 · 0 comments
Open

New subcommands #25

nicholasdille opened this issue Aug 4, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nicholasdille
Copy link
Contributor

build

generate \
| docker buildx build --platform "linux/${platform}" --tag "${image}" -

build-flat

fixes #layers < 125 for build subcommand

docker create --name docker-setup-install-flat --platform "linux/${platform}" "${base}"
for tool in ${install_tools}; do
	regctl manifest get "${REGISTRY}/${REPOSITORY_PREFIX}${tool}:${tools_version}" --platform "linux/${platform}" --format raw-body \
	| jq --raw-output '.layers[].digest' \
	| while read -r DIGEST; do
		regctl blob get "${REGISTRY}/${REPOSITORY_PREFIX}${tool}:${tools_version}" "${DIGEST}" \
		| gunzip \
		| docker cp - docker-setup-install-flat:/
	done
done
# TODO: post_install
docker commit docker-setup-install-flat "${image}"
docker rm docker-setup-install-flat >/dev/null 2>&1

install-from-registry

generate \
| docker buildx build --platform "linux/${platform}" --output "${prefix}${target}" -

install-from-image

docker image pull --quiet --platform "linux/${platform}" "${REGISTRY}/${REPOSITORY_PREFIX}${tool}:${tools_version}"
docker image save "${REGISTRY}/${REPOSITORY_PREFIX}${tool}:${tools_version}" \
| tar --extract --to-stdout manifest.json \
| jq --raw-output '.[].Layers[]' \
| while read -r FILE; do
docker image save --platform "linux/${platform}" "${REGISTRY}/${REPOSITORY_PREFIX}${tool}:${tools_version}" \
| tar --extract --to-stdout "${FILE}" \
| tar --extract --directory="${prefix}${target}" --strip-components=2
# TODO: post_install

install-from-image-build

for name in ${install_tools}; do
echo "${emoji_tool} Processing ${name}"
make -C "${docker_setup_cache}/repo" "tools/${name}/Dockerfile" "tools/${name}/manifest.json"
version="$(jq --raw-output --arg name "${name}" 'select(.version != null) | .version' <<<"${tool_json[${name}]}")"
docker buildx build "${docker_setup_cache}/repo/tools/${name}" \
	--build-arg "branch=${tools_version}" \
	--build-arg "ref=${tools_version}" \
	--build-arg "name=${name}" \
	--build-arg "version=${version}" \
	--build-arg "deps=${deps}" \
	--build-arg "tags=${tags}" \
	--platform "linux/${platform}" \
	--output "type=local,dest=${prefix}${target}"
done
# TODO: post_install

lego

see scripts/layerlego.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant