feat: preseed support
This commit is contained in:
parent
73fd88ccc0
commit
66a5605f20
2 changed files with 21 additions and 0 deletions
4
Makefile
4
Makefile
|
@ -32,6 +32,10 @@ all: \
|
|||
compat:
|
||||
./src/compat.sh
|
||||
|
||||
.PHONY: preseed
|
||||
preseed:
|
||||
./src/preseed.sh
|
||||
|
||||
.PHONY: digests
|
||||
digests:
|
||||
@for each in $$(find out -iname "index.json"| sort); do \
|
||||
|
|
17
src/preseed.sh
Executable file
17
src/preseed.sh
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
fetch(){
|
||||
line=${1?}
|
||||
local package=$(echo ${line} | sed 's/^[a-z0-9]\+ \(.*\)/\1/g');
|
||||
local hash=$(echo ${line} | sed 's/^\([a-z0-9]\+\) .*/\1/g');
|
||||
local ref=$(printf "stagex/%s@sha256:%s" "$package" "$hash");
|
||||
docker pull ${ref}
|
||||
rm -rf "out/${package}"
|
||||
mkdir -p "out/${package}"
|
||||
docker save ${ref} | tar -xC out/${package}
|
||||
}
|
||||
|
||||
while read line; do
|
||||
fetch "${line}"
|
||||
done < digests.txt
|
Loading…
Reference in a new issue