Skip to content

Instantly share code, notes, and snippets.

@h2onda
Created January 25, 2023 02:31
Show Gist options
  • Save h2onda/6992ebccd9920c045d547d002c30cf88 to your computer and use it in GitHub Desktop.
Save h2onda/6992ebccd9920c045d547d002c30cf88 to your computer and use it in GitHub Desktop.
#!/bin/sh
buildsh=$(mktemp /tmp/buildsh.XXXXXX)
cat <<-EOF > $buildsh
buildctl-daemonless.sh build \
--frontend=dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=oci,name=example:latest,dest=output.tar
EOF
cat $buildsh | \
docker run -i --rm --entrypoint sh \
-v $(pwd):/workdir --workdir /workdir \
--security-opt seccomp=unconfined \
--env BUILDKITD_FLAGS="--oci-worker-no-process-sandbox" \
moby/buildkit:rootless -s
rm $buildsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment