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
19
docs/cookbook/container/debootstrap.fs.do
Normal file
19
docs/cookbook/container/debootstrap.fs.do
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
exec >&2
|
||||
fs=${1%.fs}
|
||||
rm -rf "$fs" "$fs.fakeroot"
|
||||
|
||||
redo-ifchange debdownload.fs debootstrap.options
|
||||
cp -a debdownload/. "$fs"
|
||||
eatmydata \
|
||||
fakechroot \
|
||||
fakeroot -s "$fs.fakeroot" \
|
||||
debootstrap $(cat debootstrap.options) "$fs"
|
||||
|
||||
# Clean up installed package files
|
||||
rm -f "$fs"/var/cache/apt/archives/*.deb \
|
||||
"$fs"/var/cache/apt/*.bin \
|
||||
"$fs"/var/lib/apt/lists/*Packages \
|
||||
"$fs"/var/lib/apt/lists/*Sources \
|
||||
"$fs"/var/lib/apt/lists/debootstrap*
|
||||
|
||||
redo-ifchange "$fs/bin/sh"
|
||||
Loading…
Add table
Add a link
Reference in a new issue