cookbook/container: example of building+running docker containers.
This got... long... and complicated. But I think it's a really good demonstration of getting redo to do complicated things elegantly. At least, I hope it is.
This commit is contained in:
parent
01497f55e9
commit
3923a7d3f8
38 changed files with 1375 additions and 7 deletions
21
docs/cookbook/container/libs.fs.do
Normal file
21
docs/cookbook/container/libs.fs.do
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
exec >&2
|
||||
|
||||
fs=${1%.fs}
|
||||
redo-ifchange simple.fs
|
||||
|
||||
rm -rf "$fs"
|
||||
cp -a simple/. "$fs"
|
||||
|
||||
for full in "$fs"/bin/*; do
|
||||
if [ -x "$full" ]; then
|
||||
ldd "$full" | while read a b c junk; do
|
||||
[ "$b" = "=>" ] && a=$c
|
||||
if [ -e "$a" ]; then
|
||||
mkdir -p "$fs/lib" "$fs/$(dirname "$a")"
|
||||
cp -f "$a" "$fs/$a"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
redo-ifchange "$fs/bin/sh"
|
||||
Loading…
Add table
Add a link
Reference in a new issue