commit
f4fccc249f
|
@ -97,7 +97,7 @@ user:100000:65536
|
|||
|
||||
To change the UID/GID configuration, you need to modify and build the BuildKit image manually.
|
||||
```
|
||||
$ vi hack/dockerfiles/test.buildkit.Dockerfile
|
||||
$ vi Dockerfile
|
||||
$ make images
|
||||
$ docker run ... moby/buildkit:local-rootless ...
|
||||
```
|
||||
|
|
|
@ -24,7 +24,7 @@ binariesDocker() {
|
|||
target="linux"
|
||||
fi
|
||||
|
||||
docker build $platformFlag --build-arg BUILDKITD_TAGS="${BUILDKITD_TAGS}" --target binaries-$target --iidfile $iidfile -f ./hack/dockerfiles/test.buildkit.Dockerfile --force-rm .
|
||||
docker build $platformFlag --build-arg BUILDKITD_TAGS="${BUILDKITD_TAGS}" --target binaries-$target --iidfile $iidfile --force-rm .
|
||||
iid=$(cat $iidfile)
|
||||
containerID=$(docker create $iid copy)
|
||||
docker cp $containerID:/ bin/tmp
|
||||
|
@ -42,7 +42,6 @@ binaries() {
|
|||
fi
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
$buildkitdTagsFlags --opt target=binaries $platformFlag \
|
||||
--output type=local,dest=./bin/
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ fi
|
|||
set -x
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
$currentcontextBuildctl \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt target=binaries \
|
||||
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:binaries \
|
||||
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests \
|
||||
|
@ -31,7 +30,6 @@ buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|||
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
$currentcontextBuildctl \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt target=integration-tests-base \
|
||||
--import-cache cicache.buildk.it/moby/buildkit/master:integration-tests \
|
||||
$exportCacheFlags $exportFlags:integration-tests
|
||||
|
|
|
@ -16,7 +16,6 @@ repo="cicache.buildk.it/moby/buildkit/master"
|
|||
$(dirname $0)/login_ci_cache
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
$currentcontextBuildctl \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt target=binaries-linux-helper \
|
||||
--opt platform=$RUNC_PLATFORMS \
|
||||
--import-cache cicache.buildk.it/moby/buildkit/master:binaries-cross-helper \
|
||||
|
@ -24,6 +23,6 @@ buildctl build $progressFlag --frontend=dockerfile.v0 \
|
|||
fi
|
||||
|
||||
buildctl build --progress=plain --frontend=dockerfile.v0 \
|
||||
$currentcontextBuildctl --opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
$currentcontextBuildctl \
|
||||
--opt platform=$PLATFORMS \
|
||||
--import-cache cicache.buildk.it/moby/buildkit/master:binaries-cross-helper
|
||||
|
|
12
hack/images
12
hack/images
|
@ -25,14 +25,14 @@ if [ -z "$TAG" ] || [ -z "$REPO" ]; then
|
|||
usage
|
||||
fi
|
||||
|
||||
imageDockerCommon() {
|
||||
imageDocker() {
|
||||
if echo $PLATFORMS | grep , >/dev/null; then
|
||||
echo "PREFER_BUILDCTL=1 needs to be set to build images for $PLATFORMS"
|
||||
exit 1
|
||||
fi
|
||||
set -x
|
||||
docker build $@ --platform=$PLATFORMS -t $REPO:$TAG .
|
||||
docker build $@ --platform=$PLATFORMS -t $REPO:$TAG-rootless --target rootless .
|
||||
docker build $progressFlag --platform=$PLATFORMS -t $REPO:$TAG .
|
||||
docker build $progressFlag --platform=$PLATFORMS -t $REPO:$TAG-rootless --target rootless .
|
||||
set +x
|
||||
|
||||
if [ "$PUSH" = "push" ]; then
|
||||
|
@ -55,10 +55,6 @@ imageDockerCommon() {
|
|||
fi
|
||||
}
|
||||
|
||||
imageDocker() {
|
||||
imageDockerCommon $progressFlag -f ./hack/dockerfiles/test.buildkit.Dockerfile
|
||||
}
|
||||
|
||||
image() {
|
||||
pushFlag=""
|
||||
if [ "$PUSH" = "push" ]; then
|
||||
|
@ -76,7 +72,6 @@ image() {
|
|||
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt platform=$PLATFORMS \
|
||||
--export-cache type=inline \
|
||||
--output type=image,\"name=$REPO:$TAG$tagLatest\",$pushFlag
|
||||
|
@ -84,7 +79,6 @@ image() {
|
|||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt target=rootless \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt platform=$PLATFORMS \
|
||||
--export-cache type=inline \
|
||||
--output type=image,\"name=$REPO:$TAG-rootless$tagLatestRootless\",$pushFlag
|
||||
|
|
|
@ -11,7 +11,7 @@ if [ "$CONTINUOUS_INTEGRATION" == "true" ]; then progressFlag="--progress=plain"
|
|||
lintDocker() {
|
||||
export DOCKER_BUILDKIT=1
|
||||
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/lint.buildkit.Dockerfile --force-rm .
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/lint.Dockerfile --force-rm .
|
||||
iid=$(cat $iidfile)
|
||||
docker rmi $iid
|
||||
rm -f $iidfile
|
||||
|
@ -20,7 +20,7 @@ lintDocker() {
|
|||
lint() {
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt filename=./hack/dockerfiles/lint.buildkit.Dockerfile
|
||||
--opt filename=./hack/dockerfiles/lint.Dockerfile
|
||||
}
|
||||
|
||||
case $buildmode in
|
||||
|
|
|
@ -26,7 +26,6 @@ set -x
|
|||
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 \
|
||||
--local context=. --local dockerfile=. \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--opt target=release \
|
||||
--opt platform=$PLATFORMS \
|
||||
--exporter local \
|
||||
|
|
|
@ -48,7 +48,6 @@ case $buildmode in
|
|||
tmpfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 $currentcontextBuildctl \
|
||||
--opt target=integration-tests \
|
||||
--opt filename=./hack/dockerfiles/test.buildkit.Dockerfile \
|
||||
--output type=docker,name=$iid,dest=$tmpfile \
|
||||
--import-cache type=registry,ref=cicache.buildk.it/moby/buildkit/master:integration-tests $importCacheFlags
|
||||
docker load -i $tmpfile
|
||||
|
@ -56,7 +55,7 @@ case $buildmode in
|
|||
;;
|
||||
"docker-buildkit")
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/test.buildkit.Dockerfile --target integration-tests --force-rm .
|
||||
docker build --iidfile $iidfile --target integration-tests --force-rm .
|
||||
iid=$(cat $iidfile)
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -15,7 +15,7 @@ case $buildmode in
|
|||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. \
|
||||
--opt build-arg:GOGO_VERSION=$gogo_version \
|
||||
--opt target=update \
|
||||
--opt filename=./hack/dockerfiles/generated-files.buildkit.Dockerfile \
|
||||
--opt filename=./hack/dockerfiles/generated-files.Dockerfile \
|
||||
--output type=local,dest=$output
|
||||
cp -R "$output/generated-files/" .
|
||||
rm -rf $output
|
||||
|
@ -23,7 +23,7 @@ case $buildmode in
|
|||
"docker-buildkt")
|
||||
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker build --build-arg GOGO_VERSION=$gogo_version --iidfile $iidfile -f ./hack/dockerfiles/generated-files.buildkit.Dockerfile --target update --force-rm .
|
||||
docker build --build-arg GOGO_VERSION=$gogo_version --iidfile $iidfile -f ./hack/dockerfiles/generated-files.Dockerfile --target update --force-rm .
|
||||
iid=$(cat $iidfile)
|
||||
cid=$(docker create $iid noop)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ case $buildmode in
|
|||
output=$(mktemp -d -t buildctl-output.XXXXXXXXXX)
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. \
|
||||
--opt target=update \
|
||||
--opt filename=./hack/dockerfiles/vendor.buildkit.Dockerfile \
|
||||
--opt filename=./hack/dockerfiles/vendor.Dockerfile \
|
||||
--output type=local,dest=$output
|
||||
rm -rf ./vendor
|
||||
cp -R "$output"/out/* .
|
||||
|
@ -22,7 +22,7 @@ case $buildmode in
|
|||
"docker-buildkit")
|
||||
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/vendor.buildkit.Dockerfile --target update --force-rm .
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/vendor.Dockerfile --target update --force-rm .
|
||||
iid=$(cat $iidfile)
|
||||
cid=$(docker create $iid noop)
|
||||
rm -rf ./vendor
|
||||
|
|
|
@ -11,12 +11,12 @@ case ${1:-} in
|
|||
gogo_version=$(awk '$1 == "github.com/gogo/protobuf" { print $2 }' go.mod)
|
||||
case $buildmode in
|
||||
"buildkit")
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg:GOGO_VERSION=$gogo_version --opt target=validate --opt filename=./hack/dockerfiles/generated-files.buildkit.Dockerfile
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt build-arg:GOGO_VERSION=$gogo_version --opt target=validate --opt filename=./hack/dockerfiles/generated-files.Dockerfile
|
||||
;;
|
||||
"docker-buildkit")
|
||||
export DOCKER_BUILDKIT=1
|
||||
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
docker build --iidfile $iidfile --build-arg GOGO_VERSION=$gogo_version -f ./hack/dockerfiles/generated-files.buildkit.Dockerfile --target validate --force-rm . || exit 1
|
||||
docker build --iidfile $iidfile --build-arg GOGO_VERSION=$gogo_version -f ./hack/dockerfiles/generated-files.Dockerfile --target validate --force-rm . || exit 1
|
||||
iid=$(cat $iidfile)
|
||||
docker rmi $iid
|
||||
rm -f $iidfile
|
||||
|
|
|
@ -13,12 +13,12 @@ case ${1:-} in
|
|||
. $(dirname $0)/util
|
||||
case $buildmode in
|
||||
"buildkit")
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt filename=./hack/dockerfiles/vendor.buildkit.Dockerfile --opt target=validate
|
||||
buildctl build $progressFlag --frontend=dockerfile.v0 --local context=. --local dockerfile=. --opt filename=./hack/dockerfiles/vendor.Dockerfile --opt target=validate
|
||||
;;
|
||||
"docker-buildkit")
|
||||
export DOCKER_BUILDKIT=1
|
||||
iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX)
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/vendor.buildkit.Dockerfile --target validate --force-rm . || exit 1
|
||||
docker build --iidfile $iidfile -f ./hack/dockerfiles/vendor.Dockerfile --target validate --force-rm . || exit 1
|
||||
iid=$(cat $iidfile)
|
||||
docker rmi $iid
|
||||
rm -f $iidfile
|
||||
|
|
|
@ -20,7 +20,7 @@ func InitContainerdWorker() {
|
|||
containerd: "containerd",
|
||||
containerdShim: "containerd-shim",
|
||||
})
|
||||
// defined in hack/dockerfiles/test.buildkit.Dockerfile.
|
||||
// defined in Dockerfile
|
||||
// e.g. `containerd-1.1=/opt/containerd-1.1/bin,containerd-42.0=/opt/containerd-42.0/bin`
|
||||
if s := os.Getenv("BUILDKIT_INTEGRATION_CONTAINERD_EXTRA"); s != "" {
|
||||
entries := strings.Split(s, ",")
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
func InitOCIWorker() {
|
||||
Register(&oci{})
|
||||
|
||||
// the rootless uid is defined in hack/dockerfiles/test.buildkit.Dockerfile
|
||||
// the rootless uid is defined in Dockerfile
|
||||
if s := os.Getenv("BUILDKIT_INTEGRATION_ROOTLESS_IDPAIR"); s != "" {
|
||||
var uid, gid int
|
||||
if _, err := fmt.Sscanf(s, "%d:%d", &uid, &gid); err != nil {
|
||||
|
|
Loading…
Reference in New Issue