|
| 1 | +namespace Build.Cake.Docker; |
| 2 | + |
| 3 | +/// <summary> |
| 4 | + /// Settings for docker buildx build. |
| 5 | + /// </summary> |
| 6 | + public sealed class DockerBuildXBuildSettings : AutoToolSettings |
| 7 | + { |
| 8 | + /// <summary> |
| 9 | + /// Add a custom host-to-IP mapping (format: "host:ip") |
| 10 | + /// </summary> |
| 11 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 12 | + public string[] AddHost { get; set; } |
| 13 | + /// <summary> |
| 14 | + /// Allow extra privileged entitlement (e.g., "network.host", "security.insecure") |
| 15 | + /// </summary> |
| 16 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 17 | + public string[] Allow { get; set; } |
| 18 | + /// <summary> |
| 19 | + /// Set build-time variables |
| 20 | + /// </summary> |
| 21 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 22 | + public string[] BuildArg { get; set; } |
| 23 | + /// <summary> |
| 24 | + /// Additional build contexts (e.g., name=path) |
| 25 | + /// </summary> |
| 26 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 27 | + public string[] BuildContext { get; set; } |
| 28 | + /// <summary> |
| 29 | + /// Override the configured builder instance |
| 30 | + /// </summary> |
| 31 | + public string Builder { get; set; } |
| 32 | + /// <summary> |
| 33 | + /// External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir") |
| 34 | + /// </summary> |
| 35 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 36 | + public string[] CacheFrom { get; set; } |
| 37 | + /// <summary> |
| 38 | + /// Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir") |
| 39 | + /// </summary> |
| 40 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 41 | + public string[] CacheTo { get; set; } |
| 42 | + /// <summary> |
| 43 | + /// Optional parent cgroup for the container |
| 44 | + /// </summary> |
| 45 | + public string CgroupParent { get; set; } |
| 46 | + /// <summary> |
| 47 | + /// Compress the build context using gzip |
| 48 | + /// </summary> |
| 49 | + public bool? Compress { get; set; } |
| 50 | + /// <summary> |
| 51 | + /// Limit the CPU CFS (Completely Fair Scheduler) period |
| 52 | + /// </summary> |
| 53 | + public Int64? CpuPeriod { get; set; } |
| 54 | + /// <summary> |
| 55 | + /// Limit the CPU CFS (Completely Fair Scheduler) quota |
| 56 | + /// </summary> |
| 57 | + public Int64? CpuQuota { get; set; } |
| 58 | + /// <summary> |
| 59 | + /// CPUs in which to allow execution (0-3, 0,1) |
| 60 | + /// </summary> |
| 61 | + public string CpusetCpus { get; set; } |
| 62 | + /// <summary> |
| 63 | + /// MEMs in which to allow execution (0-3, 0,1) |
| 64 | + /// </summary> |
| 65 | + public string CpusetMems { get; set; } |
| 66 | + /// <summary> |
| 67 | + /// CPU shares (relative weight) |
| 68 | + /// </summary> |
| 69 | + public Int64? CpuShares { get; set; } |
| 70 | + /// <summary> |
| 71 | + /// Skip image verification |
| 72 | + /// </summary> |
| 73 | + [AutoProperty(Format = Constants.BoolWithTrueDefaultFormat)] |
| 74 | + public bool? DisableContentTrust { get; set; } |
| 75 | + /// <summary> |
| 76 | + /// Name of the Dockerfile (default: "PATH/Dockerfile") |
| 77 | + /// </summary> |
| 78 | + public string File { get; set; } |
| 79 | + /// <summary> |
| 80 | + /// Always remove intermediate containers |
| 81 | + /// </summary> |
| 82 | + public bool? ForceRm { get; set; } |
| 83 | + /// <summary> |
| 84 | + /// Write the image ID to the file |
| 85 | + /// </summary> |
| 86 | + public string Iidfile { get; set; } |
| 87 | + /// <summary> |
| 88 | + /// Container isolation technology |
| 89 | + /// </summary> |
| 90 | + public string Isolation { get; set; } |
| 91 | + /// <summary> |
| 92 | + /// Set metadata for an image |
| 93 | + /// </summary> |
| 94 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 95 | + public string[] Label { get; set; } |
| 96 | + /// <summary> |
| 97 | + /// Shorthand for "--output=type=docker" |
| 98 | + /// </summary> |
| 99 | + public bool Load { get; set; } |
| 100 | + /// <summary> |
| 101 | + /// Memory limit |
| 102 | + /// </summary> |
| 103 | + public string Memory { get; set; } |
| 104 | + /// <summary> |
| 105 | + /// Swap limit equal to memory plus swap: '-1' to enable unlimited swap |
| 106 | + /// </summary> |
| 107 | + public string MemorySwap { get; set; } |
| 108 | + /// <summary> |
| 109 | + /// Write build result metadata to the file |
| 110 | + /// </summary> |
| 111 | + public string MetadataFile { get; set; } |
| 112 | + /// <summary> |
| 113 | + /// Set the networking mode for the "RUN" instructions during build (default "default") |
| 114 | + /// </summary> |
| 115 | + public string Network { get; set; } |
| 116 | + /// <summary> |
| 117 | + /// Do not use cache when building the image |
| 118 | + /// </summary> |
| 119 | + public bool NoCache { get; set; } |
| 120 | + /// <summary> |
| 121 | + /// Do not cache specified stages |
| 122 | + /// </summary> |
| 123 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 124 | + public string[] NoCacheFilter { get; set; } |
| 125 | + /// <summary> |
| 126 | + /// Output destination (format: "type=local,dest=path") |
| 127 | + /// </summary> |
| 128 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 129 | + public string[] Output { get; set; } |
| 130 | + /// <summary> |
| 131 | + /// Set target platform for build |
| 132 | + /// </summary> |
| 133 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 134 | + public string[] Platform { get; set; } |
| 135 | + /// <summary> |
| 136 | + /// Set type of progress output ("auto", "plain", "tty"). Use plain to show container output (default "auto") |
| 137 | + /// </summary> |
| 138 | + public string Progress { get; set; } |
| 139 | + /// <summary> |
| 140 | + /// Always attempt to pull all referenced images |
| 141 | + /// </summary> |
| 142 | + public bool Pull { get; set; } |
| 143 | + /// <summary> |
| 144 | + /// Shorthand for "--output=type=registry" |
| 145 | + /// </summary> |
| 146 | + public bool Push { get; set; } |
| 147 | + /// <summary> |
| 148 | + /// Suppress the build output and print image ID on success |
| 149 | + /// </summary> |
| 150 | + public bool Quiet { get; set; } |
| 151 | + /// <summary> |
| 152 | + /// Remove intermediate containers after a successful build |
| 153 | + /// </summary> |
| 154 | + [AutoProperty(Format = Constants.BoolWithTrueDefaultFormat)] |
| 155 | + public bool? Rm { get; set; } |
| 156 | + /// <summary> |
| 157 | + /// Secret to expose to the build (format: "id=mysecret[,src=/local/secret]") |
| 158 | + /// </summary> |
| 159 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 160 | + public string[] Secret { get; set; } |
| 161 | + /// <summary> |
| 162 | + /// Security options |
| 163 | + /// </summary> |
| 164 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 165 | + public string[] SecurityOpt { get; set; } |
| 166 | + /// <summary> |
| 167 | + /// Size of "/dev/shm" |
| 168 | + /// </summary> |
| 169 | + public string ShmSize { get; set; } |
| 170 | + /// <summary> |
| 171 | + /// Squash newly built layers into a single new layer |
| 172 | + /// </summary> |
| 173 | + public bool? Squash { get; set; } |
| 174 | + /// <summary> |
| 175 | + /// SSH agent socket or keys to expose to the build (format: "default|<id>[=<socket>|<key>[,<key>]]") |
| 176 | + /// </summary> |
| 177 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 178 | + public string[] Ssh { get; set; } |
| 179 | + /// <summary> |
| 180 | + /// Name and optionally a tag (format: "name:tag") |
| 181 | + /// </summary> |
| 182 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 183 | + public string[] Tag { get; set; } |
| 184 | + /// <summary> |
| 185 | + /// Set the target build stage to build. |
| 186 | + /// </summary> |
| 187 | + public string Target { get; set; } |
| 188 | + /// <summary> |
| 189 | + /// Ulimit options (default []) |
| 190 | + /// </summary> |
| 191 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 192 | + public string[] Ulimit { get; set; } |
| 193 | + /// <summary> |
| 194 | + /// Set annotation for new image |
| 195 | + /// </summary> |
| 196 | + [AutoProperty(AutoArrayType = AutoArrayType.List)] |
| 197 | + public string[] Annotation { get; set; } |
| 198 | + } |
0 commit comments