Skip to content

Commit 12cb6f9

Browse files
committed
chore(DM01-5818): Enable Docker BuildKit on Infrabox
1 parent dc34cfe commit 12cb6f9

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/job/docker.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The job type docker is one of the most important jobs. You can use it to run any
1111
"command": ["echo", "hello world"],
1212
"resources": { "limits": { "cpu": 1, "memory": 1024 } },
1313
"build_only": false,
14-
"enable_docker_build_kit": true,
14+
"enable_docker_buildkit": true,
1515
"build_context": "...",
1616
"cache": { ... },
1717
"timeout": 3600,
@@ -35,7 +35,7 @@ The job type docker is one of the most important jobs. You can use it to run any
3535
|command|false|string||The command in [exec form](https://docs.docker.com/engine/reference/builder/#cmd) to be used when the container is run. Ignored if `build_only=true`|
3636
|resources|true|[Resource Configuration](/docs/job/resources.md)||Specify the required resources for your job.|
3737
|build_only|true|boolean|true|If set to true the container will only be build but not run. Use it if you only want to build a container and push it to a registry. See here for how to push to a docker registry.|
38-
|enable_docker_build_kit|false|boolean|false|If set to true, InfraBox will try to use the Dokcer Buildkit to build the containers. For more details, please refer to [Docker docs](https://docs.docker.com/develop/develop-images/build_enhancements/)|
38+
|enable_docker_buildkit|false|boolean|false|If set to true, InfraBox will try to use the Dokcer Buildkit to build the containers. For more details, please refer to [Docker docs](https://docs.docker.com/develop/develop-images/build_enhancements/)|
3939
|build_context|false|string||Specify the docker build context. If not set the directory containing the `infrabox.json` file will be used.|
4040
|cache|false|[Cache Configuration](/docs/job/cache.md)|{}|Configure the caching behavior|
4141
|timeout|false|integer|3600|Timeout in seconds after which the job should be killed. Timeout starts when the job is set to running|

docs/job/docker_compose.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Sometimes you want to start multiple containers to test your application. For th
77
"jobs": [{
88
"type": "docker-compose",
99
"name": "test",
10-
"enable_docker_build_kit": true,
10+
"enable_docker_buildkit": true,
1111
"docker_compose_file": "infrabox/test/docker-compose.yml",
1212
"resources": { "limits": { "cpu": 1, "memory": 1024 } },
1313
"cache": { ... },
@@ -22,7 +22,7 @@ Sometimes you want to start multiple containers to test your application. For th
2222
|------|----------|------|---------|-------------|
2323
|type|true|string||Has to be "docker-compose" to run multiple containers|
2424
|name|true|string||Name of the job|
25-
|enable_docker_build_kit|false|boolean|false|If set to true, InfraBox will try to use the Dokcer Buildkit to build the containers. For more details, please refer to [Docker docs](https://docs.docker.com/compose/reference/build/)|
25+
|enable_docker_buildkit|false|boolean|false|If set to true, InfraBox will try to use the Dokcer Buildkit to build the containers. For more details, please refer to [Docker docs](https://docs.docker.com/compose/reference/build/)|
2626
|docker_compose_file|true|string||Path to the `docker-compose.yml`|
2727
|resources|true|[Resource Configuration](/docs/job/resources.md)||Specify the required resources for your job|
2828
|cache|false|[Cache Configuration](/docs/job/cache.md)|{}|Configure the caching behavior|

src/job/job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def run_job_docker_compose(self, c):
739739
self.environment['PATH'] = os.environ['PATH']
740740
self.environment['DOCKER_BUILDKIT'] = '0'
741741
self.environment['COMPOSE_DOCKER_CLI_BUILD'] = '0'
742-
if self.job['definition'].get('enable_docker_build_kit', False) is True:
742+
if self.job['definition'].get('enable_docker_buildkit', False) is True:
743743
c.collect('BUILDKIT is enabled during build!', show=True)
744744
self.environment['DOCKER_BUILDKIT'] = '1'
745745
self.environment['COMPOSE_DOCKER_CLI_BUILD']= '1'
@@ -1001,7 +1001,7 @@ def build_docker_image(self, image_name, cache_image, target=None):
10011001

10021002
cwd = self._get_build_context_current_job()
10031003

1004-
if self.job['definition'].get('enable_docker_build_kit', False) is True:
1004+
if self.job['definition'].get('enable_docker_buildkit', False) is True:
10051005
os.environ['DOCKER_BUILDKIT'] = '1'
10061006

10071007
c.execute_mask(cmd, cwd=cwd, show=True, mask=self.repository.get('github_api_token', None))

src/pyinfrabox/infrabox/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def parse_docker_image(d, path):
292292

293293
def parse_docker(d, path):
294294
check_allowed_properties(d, path, ("type", "name", "docker_file", "depends_on", "resources",
295-
"build_only", "environment", "target", "enable_docker_build_kit",
295+
"build_only", "environment", "target", "enable_docker_buildkit",
296296
"build_arguments", "deployments", "timeout", "security_context", "command",
297297
"build_context", "cache", "repository", "cluster", "services", "registries"))
298298
check_required_properties(d, path, ("type", "name", "docker_file", "resources"))
@@ -312,8 +312,8 @@ def parse_docker(d, path):
312312
if 'build_only' in d:
313313
check_boolean(d['build_only'], path + ".build_only")
314314

315-
if 'enable_docker_build_kit' in d:
316-
check_boolean(d['enable_docker_build_kit'], path + ".enable_docker_build_kit" )
315+
if 'enable_docker_buildkit' in d:
316+
check_boolean(d['enable_docker_buildkit'], path + ".enable_docker_buildkit" )
317317

318318
if 'cache' in d:
319319
parse_cache(d['cache'], path + ".cache")
@@ -347,7 +347,7 @@ def parse_docker(d, path):
347347

348348

349349
def parse_docker_compose(d, path):
350-
check_allowed_properties(d, path, ("type", "name", "docker_compose_file", "depends_on", "stop_timeout", "enable_docker_build_kit",
350+
check_allowed_properties(d, path, ("type", "name", "docker_compose_file", "depends_on", "stop_timeout", "enable_docker_buildkit",
351351
"compose_profiles", "environment", "resources", "cache", "timeout", "cluster",
352352
"repository", "registries", "parallel_build"))
353353
check_required_properties(d, path, ("type", "name", "docker_compose_file", "resources"))
@@ -378,8 +378,8 @@ def parse_docker_compose(d, path):
378378
if 'registries' in d:
379379
parse_registries(d['registries'], path + '.registries')
380380

381-
if 'enable_docker_build_kit' in d:
382-
check_boolean(d['enable_docker_build_kit'], path + ".enable_docker_build_kit" )
381+
if 'enable_docker_buildkit' in d:
382+
check_boolean(d['enable_docker_buildkit'], path + ".enable_docker_buildkit" )
383383

384384

385385
def parse_wait(d, path):

0 commit comments

Comments
 (0)