1# Copyright 2022 The ChromiumOS Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5steps: 6# insecure builder required due to cros_sdk can only run in a privileged container 7- name: 'gcr.io/cloud-builders/docker' 8 args: [ 'buildx', 'create', '--use', '--name', 'insecure-builder', '--buildkitd-flags', '--allow-insecure-entitlement security.insecure'] 9- name: 'gcr.io/cloud-builders/docker' 10 args: [ 'buildx', 'build', '-t', 'gcr.io/crosvm-infra/crosvm_cros_cloudbuild', '--cache-to=type=local,dest=/docker_cache', '--allow', 'security.insecure', '.' ] 11# docker push is separated out because of https://github.com/docker/buildx/issues/1205 12- name: 'gcr.io/cloud-builders/docker' 13 args: [ 'buildx', 'stop', 'insecure-builder'] 14- name: 'gcr.io/cloud-builders/docker' 15 args: [ 'buildx', 'build', '-t', 'gcr.io/crosvm-infra/crosvm_cros_cloudbuild', '--cache-from=type=local,src=/docker_cache', '--push', '--allow', 'security.insecure', '.' ] 16timeout: 30000s 17options: 18 machineType: 'E2_HIGHCPU_32' 19 diskSizeGb: '1000' 20 volumes: 21 - name: 'docker_cache' 22 path: '/docker_cache' 23