try multiplatform build
This commit is contained in:
1 parent
c10053c8a8
commit
e9c2c355e8
1 file changed
+43
-31
+43
-31
@@ -1,36 +1,48 @@
|
||||
job("Docker") {
|
||||
host("Build and push a Docker image") {
|
||||
dockerBuildPush {
|
||||
// by default, the step runs not only 'docker build' but also 'docker push'
|
||||
// to disable pushing, add the following line:
|
||||
// push = false
|
||||
|
||||
// path to Docker context (by default, context is working dir)
|
||||
// context = "backend"
|
||||
|
||||
// path to Dockerfile relative to the project root
|
||||
// if 'file' is not specified, Docker will look for it in 'context'/Dockerfile
|
||||
//file = "docker/config/Dockerfile"
|
||||
|
||||
// build-time variables
|
||||
//args["HTTP_PROXY"] = "http://10.20.30.2:1234"
|
||||
|
||||
// image labels
|
||||
//labels["vendor"] = "mycompany"
|
||||
|
||||
// to add a raw list of additional build arguments, use
|
||||
// extraArgsForBuildCommand = listOf("...")
|
||||
|
||||
// to add a raw list of additional push arguments, use
|
||||
// extraArgsForPushCommand = listOf("...")
|
||||
|
||||
platform = "linux/arm64 linux/arm64"
|
||||
|
||||
// image tags
|
||||
tags {
|
||||
// use current job run number as a tag - '0.0.run_number'
|
||||
+"boxi.registry.jetbrains.space/p/boxit/containers/boxit-elasticsearch:0.0.${"$"}JB_SPACE_EXECUTION_NUMBER"
|
||||
}
|
||||
shellScript {
|
||||
"""
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled;
|
||||
docker buildx create --name boxites || true 2>/dev/null;
|
||||
docker buildx use boxites;
|
||||
docker buildx build \
|
||||
--platform linux/arm64,linux/amd64 \
|
||||
--tag boxi.registry.jetbrains.space/p/boxit/containers/boxit-elasticsearch:0.0.${"$"}JB_SPACE_EXECUTION_NUMBER \
|
||||
--push \
|
||||
.;
|
||||
""".trimIndent()
|
||||
}
|
||||
// dockerBuildPush {
|
||||
// // by default, the step runs not only 'docker build' but also 'docker push'
|
||||
// // to disable pushing, add the following line:
|
||||
// // push = false
|
||||
//
|
||||
// // path to Docker context (by default, context is working dir)
|
||||
// // context = "backend"
|
||||
//
|
||||
// // path to Dockerfile relative to the project root
|
||||
// // if 'file' is not specified, Docker will look for it in 'context'/Dockerfile
|
||||
// //file = "docker/config/Dockerfile"
|
||||
//
|
||||
// // build-time variables
|
||||
// //args["HTTP_PROXY"] = "http://10.20.30.2:1234"
|
||||
//
|
||||
// // image labels
|
||||
// //labels["vendor"] = "mycompany"
|
||||
//
|
||||
// // to add a raw list of additional build arguments, use
|
||||
// // extraArgsForBuildCommand = listOf("...")
|
||||
//
|
||||
// // to add a raw list of additional push arguments, use
|
||||
// // extraArgsForPushCommand = listOf("...")
|
||||
//
|
||||
// platform = "linux/arm64 linux/arm64"
|
||||
//
|
||||
// // image tags
|
||||
// tags {
|
||||
// // use current job run number as a tag - '0.0.run_number'
|
||||
// +"boxi.registry.jetbrains.space/p/boxit/containers/boxit-elasticsearch:0.0.${"$"}JB_SPACE_EXECUTION_NUMBER"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||