Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

New subcommands #6374

Closed
nicholasdille opened this issue Jun 12, 2023 · 1 comment
Closed

New subcommands #6374

nicholasdille opened this issue Jun 12, 2023 · 1 comment

Comments

@nicholasdille
Copy link
Owner

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

@nicholasdille
Copy link
Owner Author

Migrated to uniget-org/cli#25

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant