Document and add isolated OpenCode BuildKit image builder
This commit is contained in:
1 parent
3730d6c32f
commit
f33f12ef3c
2 files changed
+70
No files matched your search
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
|
||||
echo 'Usage: /root/buildkit/bin/build-image IMAGE_TAG [OUTPUT_TAR]' >&2
|
||||
exit 2
|
||||
fi
|
||||
tag=$1
|
||||
out=${2:-./image.tar}
|
||||
case "$tag$out" in *','*) echo 'Commas are not supported in tag/output path' >&2; exit 2;; esac
|
||||
test -f Dockerfile || { echo 'Run from the project directory containing Dockerfile' >&2; exit 2; }
|
||||
exec /root/buildkit/bin/buildctl \
|
||||
--addr unix:///root/buildkit/socket/buildkitd.sock build \
|
||||
--frontend dockerfile.v0 --local context=. --local dockerfile=. \
|
||||
--output "type=docker,name=$tag,dest=$out"
|
||||
Reference in new issue
Block a user