github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/pkg/api/server/register_images.go (about) 1 package server 2 3 import ( 4 "net/http" 5 6 "github.com/hanks177/podman/v4/pkg/api/handlers/compat" 7 "github.com/hanks177/podman/v4/pkg/api/handlers/libpod" 8 "github.com/gorilla/mux" 9 ) 10 11 // TODO 12 // 13 // * /images/create is missing the "message" and "platform" parameters 14 15 func (s *APIServer) registerImagesHandlers(r *mux.Router) error { 16 // swagger:operation POST /images/create compat ImageCreate 17 // --- 18 // tags: 19 // - images (compat) 20 // summary: Create an image 21 // description: Create an image by either pulling it from a registry or importing it. 22 // consumes: 23 // - text/plain 24 // - application/octet-stream 25 // produces: 26 // - application/json 27 // parameters: 28 // - in: header 29 // name: X-Registry-Auth 30 // type: string 31 // description: A base64-encoded auth configuration. 32 // - in: query 33 // name: fromImage 34 // type: string 35 // description: Name of the image to pull. The name may include a tag or digest. This parameter may only be used when pulling an image. The pull is cancelled if the HTTP connection is closed. 36 // - in: query 37 // name: fromSrc 38 // type: string 39 // description: Source to import. The value may be a URL from which the image can be retrieved or - to read the image from the request body. This parameter may only be used when importing an image 40 // - in: query 41 // name: repo 42 // type: string 43 // description: Repository name given to an image when it is imported. The repo may include a tag. This parameter may only be used when importing an image. 44 // - in: query 45 // name: tag 46 // type: string 47 // description: Tag or digest. If empty when pulling an image, this causes all tags for the given image to be pulled. 48 // - in: query 49 // name: message 50 // type: string 51 // description: Set commit message for imported image. 52 // - in: query 53 // name: platform 54 // type: string 55 // description: Platform in the format os[/arch[/variant]] 56 // - in: body 57 // name: inputImage 58 // schema: 59 // type: string 60 // format: binary 61 // description: Image content if fromSrc parameter was used 62 // responses: 63 // 200: 64 // description: "no error" 65 // schema: 66 // type: "string" 67 // format: "binary" 68 // 404: 69 // $ref: "#/responses/imageNotFound" 70 // 500: 71 // $ref: "#/responses/internalError" 72 r.Handle(VersionedPath("/images/create"), s.APIHandler(compat.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}") 73 // Added non version path to URI to support docker non versioned paths 74 r.Handle("/images/create", s.APIHandler(compat.CreateImageFromImage)).Methods(http.MethodPost).Queries("fromImage", "{fromImage}") 75 r.Handle(VersionedPath("/images/create"), s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}") 76 // Added non version path to URI to support docker non versioned paths 77 r.Handle("/images/create", s.APIHandler(compat.CreateImageFromSrc)).Methods(http.MethodPost).Queries("fromSrc", "{fromSrc}") 78 // swagger:operation GET /images/json compat ImageList 79 // --- 80 // tags: 81 // - images (compat) 82 // summary: List Images 83 // description: Returns a list of images on the server. Note that it uses a different, smaller representation of an image than inspecting a single image. 84 // parameters: 85 // - name: all 86 // in: query 87 // description: "Show all images. Only images from a final layer (no children) are shown by default." 88 // type: boolean 89 // default: false 90 // - name: filters 91 // in: query 92 // description: | 93 // A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: 94 // - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 95 // - `dangling=true` 96 // - `label=key` or `label="key=value"` of an image label 97 // - `reference`=(`<image-name>[:<tag>]`) 98 // - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 99 // type: string 100 // - name: digests 101 // in: query 102 // description: Not supported 103 // type: boolean 104 // default: false 105 // produces: 106 // - application/json 107 // responses: 108 // 200: 109 // $ref: "#/responses/imageList" 110 // 500: 111 // $ref: '#/responses/internalError' 112 r.Handle(VersionedPath("/images/json"), s.APIHandler(compat.GetImages)).Methods(http.MethodGet) 113 // Added non version path to URI to support docker non versioned paths 114 r.Handle("/images/json", s.APIHandler(compat.GetImages)).Methods(http.MethodGet) 115 // swagger:operation POST /images/load compat ImageLoad 116 // --- 117 // tags: 118 // - images (compat) 119 // summary: Import image 120 // description: Load a set of images and tags into a repository. 121 // parameters: 122 // - in: query 123 // name: quiet 124 // type: boolean 125 // description: not supported 126 // - in: body 127 // name: request 128 // description: tarball of container image 129 // schema: 130 // type: string 131 // produces: 132 // - application/json 133 // responses: 134 // 200: 135 // description: no error 136 // 500: 137 // $ref: '#/responses/internalError' 138 r.Handle(VersionedPath("/images/load"), s.APIHandler(compat.LoadImages)).Methods(http.MethodPost) 139 // Added non version path to URI to support docker non versioned paths 140 r.Handle("/images/load", s.APIHandler(compat.LoadImages)).Methods(http.MethodPost) 141 // swagger:operation POST /images/prune compat ImagePrune 142 // --- 143 // tags: 144 // - images (compat) 145 // summary: Prune unused images 146 // description: Remove images from local storage that are not being used by a container 147 // parameters: 148 // - in: query 149 // name: filters 150 // type: string 151 // description: | 152 // filters to apply to image pruning, encoded as JSON (map[string][]string). Available filters: 153 // - `dangling=<boolean>` When set to `true` (or `1`), prune only 154 // unused *and* untagged images. When set to `false` 155 // (or `0`), all unused images are pruned. 156 // - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. 157 // - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. 158 // produces: 159 // - application/json 160 // responses: 161 // 200: 162 // $ref: "#/responses/imageDeleteResponse" 163 // 500: 164 // $ref: '#/responses/internalError' 165 r.Handle(VersionedPath("/images/prune"), s.APIHandler(compat.PruneImages)).Methods(http.MethodPost) 166 // Added non version path to URI to support docker non versioned paths 167 r.Handle("/images/prune", s.APIHandler(compat.PruneImages)).Methods(http.MethodPost) 168 // swagger:operation GET /images/search compat ImageSearch 169 // --- 170 // tags: 171 // - images (compat) 172 // summary: Search images 173 // description: Search registries for an image 174 // parameters: 175 // - in: query 176 // name: term 177 // type: string 178 // description: term to search 179 // - in: query 180 // name: limit 181 // type: integer 182 // default: 25 183 // description: maximum number of results 184 // - in: query 185 // name: filters 186 // type: string 187 // description: | 188 // A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: 189 // - `is-automated=(true|false)` 190 // - `is-official=(true|false)` 191 // - `stars=<number>` Matches images that has at least 'number' stars. 192 // - in: query 193 // name: tlsVerify 194 // type: boolean 195 // default: false 196 // description: skip TLS verification for registries 197 // - in: query 198 // name: listTags 199 // type: boolean 200 // description: list the available tags in the repository 201 // produces: 202 // - application/json 203 // responses: 204 // 200: 205 // $ref: "#/responses/registrySearchResponse" 206 // 400: 207 // $ref: "#/responses/badParamError" 208 // 500: 209 // $ref: '#/responses/internalError' 210 r.Handle(VersionedPath("/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) 211 // Added non version path to URI to support docker non versioned paths 212 r.Handle("/images/search", s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) 213 // swagger:operation DELETE /images/{name} compat ImageDelete 214 // --- 215 // tags: 216 // - images (compat) 217 // summary: Remove Image 218 // description: Delete an image from local storage 219 // parameters: 220 // - in: path 221 // name: name 222 // type: string 223 // required: true 224 // description: name or ID of image to delete 225 // - in: query 226 // name: force 227 // type: boolean 228 // description: remove the image even if used by containers or has other tags 229 // - in: query 230 // name: noprune 231 // type: boolean 232 // description: not supported. will be logged as an invalid parameter if enabled 233 // produces: 234 // - application/json 235 // responses: 236 // 200: 237 // $ref: "#/responses/imageDeleteResponse" 238 // 404: 239 // $ref: '#/responses/imageNotFound' 240 // 409: 241 // $ref: '#/responses/conflictError' 242 // 500: 243 // $ref: '#/responses/internalError' 244 r.Handle(VersionedPath("/images/{name:.*}"), s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete) 245 // Added non version path to URI to support docker non versioned paths 246 r.Handle("/images/{name:.*}", s.APIHandler(compat.RemoveImage)).Methods(http.MethodDelete) 247 // swagger:operation POST /images/{name}/push compat ImagePush 248 // --- 249 // tags: 250 // - images (compat) 251 // summary: Push Image 252 // description: Push an image to a container registry 253 // parameters: 254 // - in: path 255 // name: name 256 // type: string 257 // required: true 258 // description: Name of image to push. 259 // - in: query 260 // name: tag 261 // type: string 262 // description: The tag to associate with the image on the registry. 263 // - in: query 264 // name: all 265 // type: boolean 266 // description: All indicates whether to push all images related to the image list 267 // - in: query 268 // name: compress 269 // type: boolean 270 // description: use compression on image 271 // - in: query 272 // name: destination 273 // type: string 274 // description: destination name for the image being pushed 275 // - in: header 276 // name: X-Registry-Auth 277 // type: string 278 // description: A base64-encoded auth configuration. 279 // produces: 280 // - application/json 281 // responses: 282 // 200: 283 // description: no error 284 // schema: 285 // type: string 286 // format: binary 287 // 404: 288 // $ref: '#/responses/imageNotFound' 289 // 500: 290 // $ref: '#/responses/internalError' 291 r.Handle(VersionedPath("/images/{name:.*}/push"), s.APIHandler(compat.PushImage)).Methods(http.MethodPost) 292 // Added non version path to URI to support docker non versioned paths 293 r.Handle("/images/{name:.*}/push", s.APIHandler(compat.PushImage)).Methods(http.MethodPost) 294 // swagger:operation GET /images/{name}/get compat ImageGet 295 // --- 296 // tags: 297 // - images (compat) 298 // summary: Export an image 299 // description: Export an image in tarball format 300 // parameters: 301 // - in: path 302 // name: name 303 // type: string 304 // required: true 305 // description: the name or ID of the container 306 // produces: 307 // - application/x-tar 308 // responses: 309 // 200: 310 // description: no error 311 // schema: 312 // type: string 313 // format: binary 314 // 500: 315 // $ref: '#/responses/internalError' 316 r.Handle(VersionedPath("/images/{name:.*}/get"), s.APIHandler(compat.ExportImage)).Methods(http.MethodGet) 317 // Added non version path to URI to support docker non versioned paths 318 r.Handle("/images/{name:.*}/get", s.APIHandler(compat.ExportImage)).Methods(http.MethodGet) 319 // swagger:operation GET /images/get compat ImageGetAll 320 // --- 321 // tags: 322 // - images (compat) 323 // summary: Export several images 324 // description: Get a tarball containing all images and metadata for several image repositories 325 // parameters: 326 // - in: query 327 // name: names 328 // type: string 329 // required: true 330 // description: one or more image names or IDs comma separated 331 // produces: 332 // - application/json 333 // responses: 334 // 200: 335 // description: no error 336 // schema: 337 // type: string 338 // format: binary 339 // 500: 340 // $ref: '#/responses/internalError' 341 r.Handle(VersionedPath("/images/get"), s.APIHandler(compat.ExportImages)).Methods(http.MethodGet) 342 // Added non version path to URI to support docker non versioned paths 343 r.Handle("/images/get", s.APIHandler(compat.ExportImages)).Methods(http.MethodGet) 344 // swagger:operation GET /images/{name}/history compat ImageHistory 345 // --- 346 // tags: 347 // - images (compat) 348 // summary: History of an image 349 // description: Return parent layers of an image. 350 // parameters: 351 // - in: path 352 // name: name 353 // type: string 354 // required: true 355 // description: the name or ID of the container 356 // produces: 357 // - application/json 358 // responses: 359 // 200: 360 // $ref: "#/responses/history" 361 // 404: 362 // $ref: "#/responses/imageNotFound" 363 // 500: 364 // $ref: "#/responses/internalError" 365 r.Handle(VersionedPath("/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet) 366 // Added non version path to URI to support docker non versioned paths 367 r.Handle("/images/{name:.*}/history", s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet) 368 // swagger:operation GET /images/{name}/json compat ImageInspect 369 // --- 370 // tags: 371 // - images (compat) 372 // summary: Inspect an image 373 // description: Return low-level information about an image. 374 // parameters: 375 // - in: path 376 // name: name 377 // type: string 378 // required: true 379 // description: the name or ID of the container 380 // produces: 381 // - application/json 382 // responses: 383 // 200: 384 // $ref: "#/responses/imageInspect" 385 // 404: 386 // $ref: "#/responses/imageNotFound" 387 // 500: 388 // $ref: "#/responses/internalError" 389 r.Handle(VersionedPath("/images/{name:.*}/json"), s.APIHandler(compat.GetImage)).Methods(http.MethodGet) 390 // Added non version path to URI to support docker non versioned paths 391 r.Handle("/images/{name:.*}/json", s.APIHandler(compat.GetImage)).Methods(http.MethodGet) 392 // swagger:operation POST /images/{name}/tag compat ImageTag 393 // --- 394 // tags: 395 // - images (compat) 396 // summary: Tag an image 397 // description: Tag an image so that it becomes part of a repository. 398 // parameters: 399 // - in: path 400 // name: name 401 // type: string 402 // required: true 403 // description: the name or ID of the container 404 // - in: query 405 // name: repo 406 // type: string 407 // description: the repository to tag in 408 // - in: query 409 // name: tag 410 // type: string 411 // description: the name of the new tag 412 // produces: 413 // - application/json 414 // responses: 415 // 201: 416 // description: no error 417 // 400: 418 // $ref: '#/responses/badParamError' 419 // 404: 420 // $ref: '#/responses/imageNotFound' 421 // 409: 422 // $ref: '#/responses/conflictError' 423 // 500: 424 // $ref: '#/responses/internalError' 425 r.Handle(VersionedPath("/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost) 426 // Added non version path to URI to support docker non versioned paths 427 r.Handle("/images/{name:.*}/tag", s.APIHandler(compat.TagImage)).Methods(http.MethodPost) 428 // swagger:operation POST /commit compat ImageCommit 429 // --- 430 // tags: 431 // - containers (compat) 432 // summary: New Image 433 // description: Create a new image from a container 434 // parameters: 435 // - in: query 436 // name: container 437 // type: string 438 // description: the name or ID of a container 439 // - in: query 440 // name: repo 441 // type: string 442 // description: the repository name for the created image 443 // - in: query 444 // name: tag 445 // type: string 446 // description: tag name for the created image 447 // - in: query 448 // name: comment 449 // type: string 450 // description: commit message 451 // - in: query 452 // name: author 453 // type: string 454 // description: author of the image 455 // - in: query 456 // name: pause 457 // type: boolean 458 // description: pause the container before committing it 459 // - in: query 460 // name: changes 461 // type: string 462 // description: instructions to apply while committing in Dockerfile format 463 // - in: query 464 // name: squash 465 // type: boolean 466 // description: squash newly built layers into a single new layer 467 // produces: 468 // - application/json 469 // responses: 470 // 201: 471 // description: no error 472 // 404: 473 // $ref: '#/responses/imageNotFound' 474 // 500: 475 // $ref: '#/responses/internalError' 476 r.Handle(VersionedPath("/commit"), s.APIHandler(compat.CommitContainer)).Methods(http.MethodPost) 477 // Added non version path to URI to support docker non versioned paths 478 r.Handle("/commit", s.APIHandler(compat.CommitContainer)).Methods(http.MethodPost) 479 480 // swagger:operation POST /build compat ImageBuild 481 // --- 482 // tags: 483 // - images (compat) 484 // summary: Create image 485 // description: Build an image from the given Dockerfile(s) 486 // parameters: 487 // - in: header 488 // name: Content-Type 489 // type: string 490 // default: application/x-tar 491 // enum: ["application/x-tar"] 492 // - in: header 493 // name: X-Registry-Config 494 // type: string 495 // - in: query 496 // name: dockerfile 497 // type: string 498 // default: Dockerfile 499 // description: | 500 // Path within the build context to the `Dockerfile`. 501 // This is ignored if remote is specified and points to an external `Dockerfile`. 502 // - in: query 503 // name: t 504 // type: string 505 // default: latest 506 // description: A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default latest value is assumed. You can provide several t parameters. 507 // - in: query 508 // name: extrahosts 509 // type: string 510 // default: 511 // description: | 512 // TBD Extra hosts to add to /etc/hosts 513 // (As of version 1.xx) 514 // - in: query 515 // name: remote 516 // type: string 517 // default: 518 // description: | 519 // A Git repository URI or HTTP/HTTPS context URI. 520 // If the URI points to a single text file, the file’s contents are placed 521 // into a file called Dockerfile and the image is built from that file. If 522 // the URI points to a tarball, the file is downloaded by the daemon and the 523 // contents therein used as the context for the build. If the URI points to a 524 // tarball and the dockerfile parameter is also specified, there must be a file 525 // with the corresponding path inside the tarball. 526 // (As of version 1.xx) 527 // - in: query 528 // name: q 529 // type: boolean 530 // default: false 531 // description: | 532 // Suppress verbose build output 533 // - in: query 534 // name: nocache 535 // type: boolean 536 // default: false 537 // description: | 538 // Do not use the cache when building the image 539 // (As of version 1.xx) 540 // - in: query 541 // name: cachefrom 542 // type: string 543 // default: 544 // description: | 545 // JSON array of images used to build cache resolution 546 // (As of version 1.xx) 547 // - in: query 548 // name: pull 549 // type: boolean 550 // default: false 551 // description: | 552 // Attempt to pull the image even if an older image exists locally 553 // (As of version 1.xx) 554 // - in: query 555 // name: rm 556 // type: boolean 557 // default: true 558 // description: | 559 // Remove intermediate containers after a successful build 560 // (As of version 1.xx) 561 // - in: query 562 // name: forcerm 563 // type: boolean 564 // default: false 565 // description: | 566 // Always remove intermediate containers, even upon failure 567 // (As of version 1.xx) 568 // - in: query 569 // name: memory 570 // type: integer 571 // description: | 572 // Memory is the upper limit (in bytes) on how much memory running containers can use 573 // (As of version 1.xx) 574 // - in: query 575 // name: memswap 576 // type: integer 577 // description: | 578 // MemorySwap limits the amount of memory and swap together 579 // (As of version 1.xx) 580 // - in: query 581 // name: cpushares 582 // type: integer 583 // description: | 584 // CPUShares (relative weight 585 // (As of version 1.xx) 586 // - in: query 587 // name: cpusetcpus 588 // type: string 589 // description: | 590 // CPUSetCPUs in which to allow execution (0-3, 0,1) 591 // (As of version 1.xx) 592 // - in: query 593 // name: cpuperiod 594 // type: integer 595 // description: | 596 // CPUPeriod limits the CPU CFS (Completely Fair Scheduler) period 597 // (As of version 1.xx) 598 // - in: query 599 // name: cpuquota 600 // type: integer 601 // description: | 602 // CPUQuota limits the CPU CFS (Completely Fair Scheduler) quota 603 // (As of version 1.xx) 604 // - in: query 605 // name: buildargs 606 // type: string 607 // default: 608 // description: | 609 // JSON map of string pairs denoting build-time variables. 610 // For example, the build argument `Foo` with the value of `bar` would be encoded in JSON as `["Foo":"bar"]`. 611 // 612 // For example, buildargs={"Foo":"bar"}. 613 // 614 // Note(s): 615 // * This should not be used to pass secrets. 616 // * The value of buildargs should be URI component encoded before being passed to the API. 617 // 618 // (As of version 1.xx) 619 // - in: query 620 // name: shmsize 621 // type: integer 622 // default: 67108864 623 // description: | 624 // ShmSize is the "size" value to use when mounting an shmfs on the container's /dev/shm directory. 625 // Default is 64MB 626 // (As of version 1.xx) 627 // - in: query 628 // name: squash 629 // type: boolean 630 // default: false 631 // description: | 632 // Silently ignored. 633 // Squash the resulting images layers into a single layer 634 // (As of version 1.xx) 635 // - in: query 636 // name: labels 637 // type: string 638 // default: 639 // description: | 640 // JSON map of key, value pairs to set as labels on the new image 641 // (As of version 1.xx) 642 // - in: query 643 // name: networkmode 644 // type: string 645 // default: bridge 646 // description: | 647 // Sets the networking mode for the run commands during build. 648 // Supported standard values are: 649 // * `bridge` limited to containers within a single host, port mapping required for external access 650 // * `host` no isolation between host and containers on this network 651 // * `none` disable all networking for this container 652 // * container:<nameOrID> share networking with given container 653 // ---All other values are assumed to be a custom network's name 654 // (As of version 1.xx) 655 // - in: query 656 // name: platform 657 // type: string 658 // default: 659 // description: | 660 // Platform format os[/arch[/variant]] 661 // (As of version 1.xx) 662 // - in: query 663 // name: target 664 // type: string 665 // default: 666 // description: | 667 // Target build stage 668 // (As of version 1.xx) 669 // - in: query 670 // name: outputs 671 // type: string 672 // default: 673 // description: | 674 // output configuration TBD 675 // (As of version 1.xx) 676 // - in: body 677 // name: inputStream 678 // description: | 679 // A tar archive compressed with one of the following algorithms: 680 // identity (no compression), gzip, bzip2, xz. 681 // schema: 682 // type: string 683 // format: binary 684 // produces: 685 // - application/json 686 // responses: 687 // 200: 688 // description: OK (As of version 1.xx) 689 // schema: 690 // type: object 691 // required: 692 // - stream 693 // properties: 694 // stream: 695 // type: string 696 // description: output from build process 697 // example: | 698 // (build details...) 699 // Successfully built 8ba084515c724cbf90d447a63600c0a6 700 // Successfully tagged your_image:latest 701 // 400: 702 // $ref: "#/responses/badParamError" 703 // 500: 704 // $ref: "#/responses/internalError" 705 r.Handle(VersionedPath("/build"), s.APIHandler(compat.BuildImage)).Methods(http.MethodPost) 706 // Added non version path to URI to support docker non versioned paths 707 r.Handle("/build", s.APIHandler(compat.BuildImage)).Methods(http.MethodPost) 708 /* 709 libpod endpoints 710 */ 711 712 // swagger:operation POST /libpod/images/{name}/push libpod ImagePushLibpod 713 // --- 714 // tags: 715 // - images 716 // summary: Push Image 717 // description: Push an image to a container registry 718 // parameters: 719 // - in: path 720 // name: name 721 // type: string 722 // required: true 723 // description: Name of image to push. 724 // - in: query 725 // name: destination 726 // type: string 727 // description: Allows for pushing the image to a different destination than the image refers to. 728 // - in: query 729 // name: tlsVerify 730 // description: Require TLS verification. 731 // type: boolean 732 // default: true 733 // - in: header 734 // name: X-Registry-Auth 735 // type: string 736 // description: A base64-encoded auth configuration. 737 // produces: 738 // - application/json 739 // responses: 740 // 200: 741 // description: no error 742 // schema: 743 // type: string 744 // format: binary 745 // 404: 746 // $ref: '#/responses/imageNotFound' 747 // 500: 748 // $ref: '#/responses/internalError' 749 r.Handle(VersionedPath("/libpod/images/{name:.*}/push"), s.APIHandler(libpod.PushImage)).Methods(http.MethodPost) 750 // swagger:operation GET /libpod/images/{name}/exists libpod ImageExistsLibpod 751 // --- 752 // tags: 753 // - images 754 // summary: Image exists 755 // description: Check if image exists in local store 756 // parameters: 757 // - in: path 758 // name: name 759 // type: string 760 // required: true 761 // description: the name or ID of the container 762 // produces: 763 // - application/json 764 // responses: 765 // 204: 766 // description: image exists 767 // 404: 768 // $ref: '#/responses/imageNotFound' 769 // 500: 770 // $ref: '#/responses/internalError' 771 r.Handle(VersionedPath("/libpod/images/{name:.*}/exists"), s.APIHandler(libpod.ImageExists)).Methods(http.MethodGet) 772 // swagger:operation GET /libpod/images/{name}/tree libpod ImageTreeLibpod 773 // --- 774 // tags: 775 // - images 776 // summary: Image tree 777 // description: Retrieve the image tree for the provided image name or ID 778 // parameters: 779 // - in: path 780 // name: name 781 // type: string 782 // required: true 783 // description: the name or ID of the container 784 // - in: query 785 // name: whatrequires 786 // type: boolean 787 // description: show all child images and layers of the specified image 788 // produces: 789 // - application/json 790 // responses: 791 // 200: 792 // $ref: "#/responses/treeResponse" 793 // 404: 794 // $ref: '#/responses/imageNotFound' 795 // 500: 796 // $ref: '#/responses/internalError' 797 r.Handle(VersionedPath("/libpod/images/{name:.*}/tree"), s.APIHandler(libpod.ImageTree)).Methods(http.MethodGet) 798 // swagger:operation GET /libpod/images/{name}/history libpod ImageHistoryLibpod 799 // --- 800 // tags: 801 // - images 802 // summary: History of an image 803 // description: Return parent layers of an image. 804 // parameters: 805 // - in: path 806 // name: name 807 // type: string 808 // required: true 809 // description: the name or ID of the container 810 // produces: 811 // - application/json 812 // responses: 813 // 200: 814 // $ref: "#/responses/history" 815 // 404: 816 // $ref: '#/responses/imageNotFound' 817 // 500: 818 // $ref: '#/responses/internalError' 819 r.Handle(VersionedPath("/libpod/images/{name:.*}/history"), s.APIHandler(compat.HistoryImage)).Methods(http.MethodGet) 820 // swagger:operation GET /libpod/images/json libpod ImageListLibpod 821 // --- 822 // tags: 823 // - images 824 // summary: List Images 825 // description: Returns a list of images on the server 826 // parameters: 827 // - name: all 828 // in: query 829 // description: Show all images. Only images from a final layer (no children) are shown by default. 830 // type: boolean 831 // default: false 832 // - name: filters 833 // in: query 834 // description: | 835 // A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: 836 // - `before`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 837 // - `dangling=true` 838 // - `label=key` or `label="key=value"` of an image label 839 // - `reference`=(`<image-name>[:<tag>]`) 840 // - `id`=(`<image-id>`) 841 // - `since`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`) 842 // type: string 843 // produces: 844 // - application/json 845 // responses: 846 // 200: 847 // $ref: "#/responses/imageListLibpod" 848 // 500: 849 // $ref: '#/responses/internalError' 850 r.Handle(VersionedPath("/libpod/images/json"), s.APIHandler(compat.GetImages)).Methods(http.MethodGet) 851 // swagger:operation POST /libpod/images/load libpod ImageLoadLibpod 852 // --- 853 // tags: 854 // - images 855 // summary: Load image 856 // description: Load an image (oci-archive or docker-archive) stream. 857 // parameters: 858 // - in: body 859 // name: upload 860 // required: true 861 // description: tarball of container image 862 // schema: 863 // type: string 864 // consumes: 865 // - application/x-tar 866 // produces: 867 // - application/json 868 // responses: 869 // 200: 870 // $ref: "#/responses/imagesLoadResponseLibpod" 871 // 400: 872 // $ref: "#/responses/badParamError" 873 // 500: 874 // $ref: '#/responses/internalError' 875 r.Handle(VersionedPath("/libpod/images/load"), s.APIHandler(libpod.ImagesLoad)).Methods(http.MethodPost) 876 // swagger:operation POST /libpod/images/import libpod ImageImportLibpod 877 // --- 878 // tags: 879 // - images 880 // summary: Import image 881 // description: Import a previously exported tarball as an image. 882 // parameters: 883 // - in: header 884 // name: Content-Type 885 // type: string 886 // default: application/x-tar 887 // enum: ["application/x-tar"] 888 // - in: query 889 // name: changes 890 // description: "Apply the following possible instructions to the created image: CMD | ENTRYPOINT | ENV | EXPOSE | LABEL | STOPSIGNAL | USER | VOLUME | WORKDIR. JSON encoded string" 891 // type: array 892 // items: 893 // type: string 894 // - in: query 895 // name: message 896 // description: Set commit message for imported image 897 // type: string 898 // - in: query 899 // name: reference 900 // description: "Optional Name[:TAG] for the image" 901 // type: string 902 // - in: query 903 // name: url 904 // description: Load image from the specified URL 905 // type: string 906 // - in: body 907 // name: upload 908 // required: true 909 // description: tarball for imported image 910 // schema: 911 // type: string 912 // format: binary 913 // produces: 914 // - application/json 915 // consumes: 916 // - application/x-tar 917 // responses: 918 // 200: 919 // $ref: "#/responses/imagesImportResponseLibpod" 920 // 400: 921 // $ref: "#/responses/badParamError" 922 // 500: 923 // $ref: '#/responses/internalError' 924 r.Handle(VersionedPath("/libpod/images/import"), s.APIHandler(libpod.ImagesImport)).Methods(http.MethodPost) 925 // swagger:operation DELETE /libpod/images/remove libpod ImageDeleteAllLibpod 926 // --- 927 // tags: 928 // - images 929 // summary: Remove one or more images from the storage. 930 // description: Remove one or more images from the storage. 931 // parameters: 932 // - in: query 933 // name: images 934 // description: Images IDs or names to remove. 935 // type: array 936 // items: 937 // type: string 938 // - in: query 939 // name: all 940 // description: Remove all images. 941 // type: boolean 942 // default: true 943 // - in: query 944 // name: force 945 // description: Force image removal (including containers using the images). 946 // type: boolean 947 // - in: query 948 // name: ignore 949 // description: Ignore if a specified image does not exist and do not throw an error. 950 // type: boolean 951 // produces: 952 // - application/json 953 // responses: 954 // 200: 955 // $ref: "#/responses/imagesRemoveResponseLibpod" 956 // 400: 957 // $ref: "#/responses/badParamError" 958 // 500: 959 // $ref: '#/responses/internalError' 960 r.Handle(VersionedPath("/libpod/images/remove"), s.APIHandler(libpod.ImagesBatchRemove)).Methods(http.MethodDelete) 961 // swagger:operation DELETE /libpod/images/{name} libpod ImageDeleteLibpod 962 // --- 963 // tags: 964 // - images 965 // summary: Remove an image from the local storage. 966 // description: Remove an image from the local storage. 967 // parameters: 968 // - in: path 969 // name: name 970 // type: string 971 // required: true 972 // description: name or ID of image to remove 973 // - in: query 974 // name: force 975 // type: boolean 976 // description: remove the image even if used by containers or has other tags 977 // produces: 978 // - application/json 979 // responses: 980 // 200: 981 // $ref: "#/responses/imagesRemoveResponseLibpod" 982 // 400: 983 // $ref: "#/responses/badParamError" 984 // 404: 985 // $ref: '#/responses/imageNotFound' 986 // 409: 987 // $ref: '#/responses/conflictError' 988 // 500: 989 // $ref: '#/responses/internalError' 990 r.Handle(VersionedPath("/libpod/images/{name:.*}"), s.APIHandler(libpod.ImagesRemove)).Methods(http.MethodDelete) 991 // swagger:operation POST /libpod/images/pull libpod ImagePullLibpod 992 // --- 993 // tags: 994 // - images 995 // summary: Pull images 996 // description: Pull one or more images from a container registry. 997 // parameters: 998 // - in: query 999 // name: reference 1000 // description: "Mandatory reference to the image (e.g., quay.io/image/name:tag)" 1001 // type: string 1002 // - in: query 1003 // name: quiet 1004 // description: "silences extra stream data on pull" 1005 // type: boolean 1006 // default: false 1007 // - in: query 1008 // name: credentials 1009 // description: "username:password for the registry" 1010 // type: string 1011 // - in: query 1012 // name: Arch 1013 // description: Pull image for the specified architecture. 1014 // type: string 1015 // - in: query 1016 // name: OS 1017 // description: Pull image for the specified operating system. 1018 // type: string 1019 // - in: query 1020 // name: Variant 1021 // description: Pull image for the specified variant. 1022 // type: string 1023 // - in: query 1024 // name: policy 1025 // description: Pull policy, "always" (default), "missing", "newer", "never". 1026 // type: string 1027 // - in: query 1028 // name: tlsVerify 1029 // description: Require TLS verification. 1030 // type: boolean 1031 // default: true 1032 // - in: query 1033 // name: allTags 1034 // description: Pull all tagged images in the repository. 1035 // type: boolean 1036 // - in: header 1037 // name: X-Registry-Auth 1038 // description: "base-64 encoded auth config. Must include the following four values: username, password, email and server address OR simply just an identity token." 1039 // type: string 1040 // produces: 1041 // - application/json 1042 // responses: 1043 // 200: 1044 // $ref: "#/responses/imagesPullResponseLibpod" 1045 // 400: 1046 // $ref: "#/responses/badParamError" 1047 // 500: 1048 // $ref: '#/responses/internalError' 1049 r.Handle(VersionedPath("/libpod/images/pull"), s.APIHandler(libpod.ImagesPull)).Methods(http.MethodPost) 1050 // swagger:operation POST /libpod/images/prune libpod ImagePruneLibpod 1051 // --- 1052 // tags: 1053 // - images 1054 // summary: Prune unused images 1055 // description: Remove images that are not being used by a container 1056 // parameters: 1057 // - in: query 1058 // name: all 1059 // default: false 1060 // type: boolean 1061 // description: | 1062 // Remove all images not in use by containers, not just dangling ones 1063 // - in: query 1064 // name: external 1065 // default: false 1066 // type: boolean 1067 // description: | 1068 // Remove images even when they are used by external containers (e.g, by build containers) 1069 // - in: query 1070 // name: filters 1071 // type: string 1072 // description: | 1073 // filters to apply to image pruning, encoded as JSON (map[string][]string). Available filters: 1074 // - `dangling=<boolean>` When set to `true` (or `1`), prune only 1075 // unused *and* untagged images. When set to `false` 1076 // (or `0`), all unused images are pruned. 1077 // - `until=<string>` Prune images created before this timestamp. The `<timestamp>` can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed relative to the daemon machine’s time. 1078 // - `label` (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) Prune images with (or without, in case `label!=...` is used) the specified labels. 1079 // produces: 1080 // - application/json 1081 // responses: 1082 // 200: 1083 // $ref: "#/responses/imagesPruneLibpod" 1084 // 500: 1085 // $ref: '#/responses/internalError' 1086 r.Handle(VersionedPath("/libpod/images/prune"), s.APIHandler(libpod.PruneImages)).Methods(http.MethodPost) 1087 // swagger:operation GET /libpod/images/search libpod ImageSearchLibpod 1088 // --- 1089 // tags: 1090 // - images 1091 // summary: Search images 1092 // description: Search registries for images 1093 // parameters: 1094 // - in: query 1095 // name: term 1096 // type: string 1097 // description: term to search 1098 // - in: query 1099 // name: limit 1100 // type: integer 1101 // default: 25 1102 // description: maximum number of results 1103 // - in: query 1104 // name: filters 1105 // type: string 1106 // description: | 1107 // A JSON encoded value of the filters (a `map[string][]string`) to process on the images list. Available filters: 1108 // - `is-automated=(true|false)` 1109 // - `is-official=(true|false)` 1110 // - `stars=<number>` Matches images that has at least 'number' stars. 1111 // - in: query 1112 // name: tlsVerify 1113 // type: boolean 1114 // default: false 1115 // description: skip TLS verification for registries 1116 // - in: query 1117 // name: listTags 1118 // type: boolean 1119 // default: false 1120 // description: list the available tags in the repository 1121 // produces: 1122 // - application/json 1123 // responses: 1124 // 200: 1125 // $ref: "#/responses/registrySearchResponse" 1126 // 500: 1127 // $ref: '#/responses/internalError' 1128 r.Handle(VersionedPath("/libpod/images/search"), s.APIHandler(compat.SearchImages)).Methods(http.MethodGet) 1129 // swagger:operation GET /libpod/images/{name}/get libpod ImageGetLibpod 1130 // --- 1131 // tags: 1132 // - images 1133 // summary: Export an image 1134 // description: Export an image 1135 // parameters: 1136 // - in: path 1137 // name: name 1138 // type: string 1139 // required: true 1140 // description: the name or ID of the container 1141 // - in: query 1142 // name: format 1143 // type: string 1144 // description: format for exported image 1145 // - in: query 1146 // name: compress 1147 // type: boolean 1148 // description: use compression on image 1149 // produces: 1150 // - application/x-tar 1151 // responses: 1152 // 200: 1153 // description: no error 1154 // schema: 1155 // type: string 1156 // format: binary 1157 // 404: 1158 // $ref: '#/responses/imageNotFound' 1159 // 500: 1160 // $ref: '#/responses/internalError' 1161 r.Handle(VersionedPath("/libpod/images/{name:.*}/get"), s.APIHandler(libpod.ExportImage)).Methods(http.MethodGet) 1162 // swagger:operation GET /libpod/images/export libpod ImageExportLibpod 1163 // --- 1164 // tags: 1165 // - images 1166 // summary: Export multiple images 1167 // description: Export multiple images into a single object. Only `docker-archive` is currently supported. 1168 // parameters: 1169 // - in: query 1170 // name: format 1171 // type: string 1172 // description: format for exported image (only docker-archive is supported) 1173 // - in: query 1174 // name: references 1175 // description: references to images to export 1176 // type: array 1177 // items: 1178 // type: string 1179 // - in: query 1180 // name: compress 1181 // type: boolean 1182 // description: use compression on image 1183 // - in: query 1184 // name: ociAcceptUncompressedLayers 1185 // type: boolean 1186 // description: accept uncompressed layers when copying OCI images 1187 // produces: 1188 // - application/json 1189 // responses: 1190 // 200: 1191 // description: no error 1192 // schema: 1193 // type: string 1194 // format: binary 1195 // 404: 1196 // $ref: '#/responses/imageNotFound' 1197 // 500: 1198 // $ref: '#/responses/internalError' 1199 r.Handle(VersionedPath("/libpod/images/export"), s.APIHandler(libpod.ExportImages)).Methods(http.MethodGet) 1200 // swagger:operation GET /libpod/images/{name}/json libpod ImageInspectLibpod 1201 // --- 1202 // tags: 1203 // - images 1204 // summary: Inspect an image 1205 // description: Obtain low-level information about an image 1206 // parameters: 1207 // - in: path 1208 // name: name 1209 // type: string 1210 // required: true 1211 // description: the name or ID of the container 1212 // produces: 1213 // - application/json 1214 // responses: 1215 // 200: 1216 // $ref: "#/responses/inspectImageResponseLibpod" 1217 // 404: 1218 // $ref: '#/responses/imageNotFound' 1219 // 500: 1220 // $ref: '#/responses/internalError' 1221 r.Handle(VersionedPath("/libpod/images/{name:.*}/json"), s.APIHandler(libpod.GetImage)).Methods(http.MethodGet) 1222 // swagger:operation POST /libpod/images/{name}/tag libpod ImageTagLibpod 1223 // --- 1224 // tags: 1225 // - images 1226 // summary: Tag an image 1227 // description: Tag an image so that it becomes part of a repository. 1228 // parameters: 1229 // - in: path 1230 // name: name 1231 // type: string 1232 // required: true 1233 // description: the name or ID of the container 1234 // - in: query 1235 // name: repo 1236 // type: string 1237 // description: the repository to tag in 1238 // - in: query 1239 // name: tag 1240 // type: string 1241 // description: the name of the new tag 1242 // produces: 1243 // - application/json 1244 // responses: 1245 // 201: 1246 // description: no error 1247 // 400: 1248 // $ref: '#/responses/badParamError' 1249 // 404: 1250 // $ref: '#/responses/imageNotFound' 1251 // 409: 1252 // $ref: '#/responses/conflictError' 1253 // 500: 1254 // $ref: '#/responses/internalError' 1255 r.Handle(VersionedPath("/libpod/images/{name:.*}/tag"), s.APIHandler(compat.TagImage)).Methods(http.MethodPost) 1256 // swagger:operation POST /libpod/commit libpod ImageCommitLibpod 1257 // --- 1258 // tags: 1259 // - containers 1260 // summary: Commit 1261 // description: Create a new image from a container 1262 // parameters: 1263 // - in: query 1264 // name: container 1265 // type: string 1266 // description: the name or ID of a container 1267 // required: true 1268 // - in: query 1269 // name: repo 1270 // type: string 1271 // description: the repository name for the created image 1272 // - in: query 1273 // name: tag 1274 // type: string 1275 // description: tag name for the created image 1276 // - in: query 1277 // name: comment 1278 // type: string 1279 // description: commit message 1280 // - in: query 1281 // name: author 1282 // type: string 1283 // description: author of the image 1284 // - in: query 1285 // name: pause 1286 // type: boolean 1287 // description: pause the container before committing it 1288 // - in: query 1289 // name: changes 1290 // description: instructions to apply while committing in Dockerfile format (i.e. "CMD=/bin/foo") 1291 // type: array 1292 // items: 1293 // type: string 1294 // - in: query 1295 // name: format 1296 // type: string 1297 // description: format of the image manifest and metadata (default "oci") 1298 // produces: 1299 // - application/json 1300 // responses: 1301 // 201: 1302 // description: no error 1303 // 404: 1304 // $ref: '#/responses/imageNotFound' 1305 // 500: 1306 // $ref: '#/responses/internalError' 1307 r.Handle(VersionedPath("/libpod/commit"), s.APIHandler(libpod.CommitContainer)).Methods(http.MethodPost) 1308 // swagger:operation POST /libpod/images/{name}/untag libpod ImageUntagLibpod 1309 // --- 1310 // tags: 1311 // - images 1312 // summary: Untag an image 1313 // description: Untag an image. If not repo and tag are specified, all tags are removed from the image. 1314 // parameters: 1315 // - in: path 1316 // name: name 1317 // type: string 1318 // required: true 1319 // description: the name or ID of the container 1320 // - in: query 1321 // name: repo 1322 // type: string 1323 // description: the repository to untag 1324 // - in: query 1325 // name: tag 1326 // type: string 1327 // description: the name of the tag to untag 1328 // produces: 1329 // - application/json 1330 // responses: 1331 // 201: 1332 // description: no error 1333 // 400: 1334 // $ref: '#/responses/badParamError' 1335 // 404: 1336 // $ref: '#/responses/imageNotFound' 1337 // 409: 1338 // $ref: '#/responses/conflictError' 1339 // 500: 1340 // $ref: '#/responses/internalError' 1341 r.Handle(VersionedPath("/libpod/images/{name:.*}/untag"), s.APIHandler(libpod.UntagImage)).Methods(http.MethodPost) 1342 1343 // swagger:operation GET /libpod/images/{name}/changes libpod ImageChangesLibpod 1344 // --- 1345 // tags: 1346 // - images 1347 // summary: Report on changes to images's filesystem; adds, deletes or modifications. 1348 // description: | 1349 // Returns which files in a images's filesystem have been added, deleted, or modified. The Kind of modification can be one of: 1350 // 1351 // 0: Modified 1352 // 1: Added 1353 // 2: Deleted 1354 // parameters: 1355 // - in: path 1356 // name: name 1357 // type: string 1358 // required: true 1359 // description: the name or id of the image 1360 // - in: query 1361 // name: parent 1362 // type: string 1363 // description: specify a second layer which is used to compare against it instead of the parent layer 1364 // - in: query 1365 // name: diffType 1366 // type: string 1367 // enum: [all, container, image] 1368 // description: select what you want to match, default is all 1369 // responses: 1370 // 200: 1371 // description: Array of Changes 1372 // content: 1373 // application/json: 1374 // schema: 1375 // $ref: "#/responses/Changes" 1376 // 404: 1377 // $ref: "#/responses/containerNotFound" 1378 // 500: 1379 // $ref: "#/responses/internalError" 1380 r.HandleFunc(VersionedPath("/libpod/images/{name}/changes"), s.APIHandler(compat.Changes)).Methods(http.MethodGet) 1381 1382 // swagger:operation POST /libpod/build libpod ImageBuildLibpod 1383 // --- 1384 // tags: 1385 // - images 1386 // summary: Create image 1387 // description: Build an image from the given Dockerfile(s) 1388 // parameters: 1389 // - in: query 1390 // name: dockerfile 1391 // type: string 1392 // default: Dockerfile 1393 // description: | 1394 // Path within the build context to the `Dockerfile`. 1395 // This is ignored if remote is specified and points to an external `Dockerfile`. 1396 // - in: query 1397 // name: t 1398 // type: string 1399 // default: latest 1400 // description: A name and optional tag to apply to the image in the `name:tag` format. If you omit the tag the default latest value is assumed. You can provide several t parameters. 1401 // - in: query 1402 // name: allplatforms 1403 // type: boolean 1404 // default: false 1405 // description: | 1406 // Instead of building for a set of platforms specified using the platform option, inspect the build's base images, 1407 // and build for all of the platforms that are available. Stages that use *scratch* as a starting point can not be inspected, 1408 // so at least one non-*scratch* stage must be present for detection to work usefully. 1409 // - in: query 1410 // name: extrahosts 1411 // type: string 1412 // default: 1413 // description: | 1414 // TBD Extra hosts to add to /etc/hosts 1415 // (As of version 1.xx) 1416 // - in: query 1417 // name: remote 1418 // type: string 1419 // default: 1420 // description: | 1421 // A Git repository URI or HTTP/HTTPS context URI. 1422 // If the URI points to a single text file, the file’s contents are placed 1423 // into a file called Dockerfile and the image is built from that file. If 1424 // the URI points to a tarball, the file is downloaded by the daemon and the 1425 // contents therein used as the context for the build. If the URI points to a 1426 // tarball and the dockerfile parameter is also specified, there must be a file 1427 // with the corresponding path inside the tarball. 1428 // (As of version 1.xx) 1429 // - in: query 1430 // name: q 1431 // type: boolean 1432 // default: false 1433 // description: | 1434 // Suppress verbose build output 1435 // - in: query 1436 // name: nocache 1437 // type: boolean 1438 // default: false 1439 // description: | 1440 // Do not use the cache when building the image 1441 // (As of version 1.xx) 1442 // - in: query 1443 // name: cachefrom 1444 // type: string 1445 // default: 1446 // description: | 1447 // JSON array of images used to build cache resolution 1448 // (As of version 1.xx) 1449 // - in: query 1450 // name: pull 1451 // type: boolean 1452 // default: false 1453 // description: | 1454 // Attempt to pull the image even if an older image exists locally 1455 // (As of version 1.xx) 1456 // - in: query 1457 // name: rm 1458 // type: boolean 1459 // default: true 1460 // description: | 1461 // Remove intermediate containers after a successful build 1462 // (As of version 1.xx) 1463 // - in: query 1464 // name: forcerm 1465 // type: boolean 1466 // default: false 1467 // description: | 1468 // Always remove intermediate containers, even upon failure 1469 // (As of version 1.xx) 1470 // - in: query 1471 // name: memory 1472 // type: integer 1473 // description: | 1474 // Memory is the upper limit (in bytes) on how much memory running containers can use 1475 // (As of version 1.xx) 1476 // - in: query 1477 // name: memswap 1478 // type: integer 1479 // description: | 1480 // MemorySwap limits the amount of memory and swap together 1481 // (As of version 1.xx) 1482 // - in: query 1483 // name: cpushares 1484 // type: integer 1485 // description: | 1486 // CPUShares (relative weight 1487 // (As of version 1.xx) 1488 // - in: query 1489 // name: cpusetcpus 1490 // type: string 1491 // description: | 1492 // CPUSetCPUs in which to allow execution (0-3, 0,1) 1493 // (As of version 1.xx) 1494 // - in: query 1495 // name: cpuperiod 1496 // type: integer 1497 // description: | 1498 // CPUPeriod limits the CPU CFS (Completely Fair Scheduler) period 1499 // (As of version 1.xx) 1500 // - in: query 1501 // name: cpuquota 1502 // type: integer 1503 // description: | 1504 // CPUQuota limits the CPU CFS (Completely Fair Scheduler) quota 1505 // (As of version 1.xx) 1506 // - in: query 1507 // name: buildargs 1508 // type: string 1509 // default: 1510 // description: | 1511 // JSON map of string pairs denoting build-time variables. 1512 // For example, the build argument `Foo` with the value of `bar` would be encoded in JSON as `["Foo":"bar"]`. 1513 // 1514 // For example, buildargs={"Foo":"bar"}. 1515 // 1516 // Note(s): 1517 // * This should not be used to pass secrets. 1518 // * The value of buildargs should be URI component encoded before being passed to the API. 1519 // 1520 // (As of version 1.xx) 1521 // - in: query 1522 // name: shmsize 1523 // type: integer 1524 // default: 67108864 1525 // description: | 1526 // ShmSize is the "size" value to use when mounting an shmfs on the container's /dev/shm directory. 1527 // Default is 64MB 1528 // (As of version 1.xx) 1529 // - in: query 1530 // name: squash 1531 // type: boolean 1532 // default: false 1533 // description: | 1534 // Silently ignored. 1535 // Squash the resulting images layers into a single layer 1536 // (As of version 1.xx) 1537 // - in: query 1538 // name: labels 1539 // type: string 1540 // default: 1541 // description: | 1542 // JSON map of key, value pairs to set as labels on the new image 1543 // (As of version 1.xx) 1544 // - in: query 1545 // name: layers 1546 // type: boolean 1547 // default: true 1548 // description: | 1549 // Cache intermediate layers during build. 1550 // (As of version 1.xx) 1551 // - in: query 1552 // name: networkmode 1553 // type: string 1554 // default: bridge 1555 // description: | 1556 // Sets the networking mode for the run commands during build. 1557 // Supported standard values are: 1558 // * `bridge` limited to containers within a single host, port mapping required for external access 1559 // * `host` no isolation between host and containers on this network 1560 // * `none` disable all networking for this container 1561 // * container:<nameOrID> share networking with given container 1562 // ---All other values are assumed to be a custom network's name 1563 // (As of version 1.xx) 1564 // - in: query 1565 // name: platform 1566 // type: string 1567 // default: 1568 // description: | 1569 // Platform format os[/arch[/variant]] 1570 // (As of version 1.xx) 1571 // - in: query 1572 // name: target 1573 // type: string 1574 // default: 1575 // description: | 1576 // Target build stage 1577 // (As of version 1.xx) 1578 // - in: query 1579 // name: outputs 1580 // type: string 1581 // default: 1582 // description: | 1583 // output configuration TBD 1584 // (As of version 1.xx) 1585 // - in: query 1586 // name: httpproxy 1587 // type: boolean 1588 // default: 1589 // description: | 1590 // Inject http proxy environment variables into container 1591 // (As of version 2.0.0) 1592 // - in: query 1593 // name: unsetenv 1594 // description: Unset environment variables from the final image. 1595 // type: array 1596 // items: 1597 // type: string 1598 // produces: 1599 // - application/json 1600 // responses: 1601 // 200: 1602 // description: OK (As of version 1.xx) 1603 // schema: 1604 // type: object 1605 // required: 1606 // - stream 1607 // properties: 1608 // stream: 1609 // type: string 1610 // description: output from build process 1611 // example: | 1612 // (build details...) 1613 // 400: 1614 // $ref: "#/responses/badParamError" 1615 // 500: 1616 // $ref: "#/responses/internalError" 1617 r.Handle(VersionedPath("/libpod/build"), s.APIHandler(compat.BuildImage)).Methods(http.MethodPost) 1618 return nil 1619 }