2 Managing Docker Containers and Images
(require remote-shell/docker) | package: remote-shell-lib |
Added in version 1.3 of package remote-shell-lib.
procedure
(docker-build #:name name #:content content [ #:platform platform]) → void? name : string? content : path-string? platform : (or/c string?) = #f
Changed in version 1.7 of package remote-shell-lib: Added the #:platform argument.
procedure
(docker-create #:name name #:image-name image-name [ #:platform platform #:network network #:volumes volumes #:envvars envvars #:ports ports #:memory-mb memory-mb #:swap-mb swap-mb #:replace? replace?]) → string? name : string? image-name : string? platform : (or/c #f string?) = #f network : (or/c #f string?) = #f
volumes : (listof (list/c path-string? string? (or/c 'ro 'rw))) = '()
envvars :
(hash/c (or/c bytes-environment-variable-name? string-environment-variable-name?) (or/c string-no-nuls? bytes-no-nuls?)) = (hash)
ports : (hash/c listen-port-number? listen-port-number?) = (hash) memory-mb : (or/c #f exact-positive-integer?) = #f swap-mb : (or/c #f exact-positive-integer?) = #f replace? : boolean? = #f
If platform is a string, then the created container uses that platform. Specifying a platform is useful when a host can run multiple platforms and image-name is also available for multiple platforms.
If network is a string, then the created container uses that network.
The volumes argument supplies a mapping of host directories to container directory paths, where the path on the container maps to the host directory in the indicated mode: 'ro for read-only or 'rw for read–write.
The envvars argument supplies a mapping of environment variable names to values for the container’s environment.
The ports argument supplies a mapping of host port numbers to container port numbers, where attempts to connect to the host port number at the host will be forward to the container at the container’s port number. Using 0 as the host port allocates an ephemeral port for the host.
The memory-mb and swap-mb arguments determine the amount of memory that the container can use in megabytes (MB), where memory-mb is “real” memory and swap-mb is additional swap space. If only one of the numbers is provided, the default for the other is the same (i.e., by default, the total amount of memory available including swap space is twice the provided value). If neither is provided as a number, no specific limit is imposed on the container.
Changed in version 1.5 of package remote-shell-lib: Added #:memory-mb and #:swap-mb.
Changed in version 1.6: Added #:platform.
Changed in version 1.8: Added #:envvars and #:ports.
procedure
(docker-exec #:name name command arg ... [ #:mode mode]) → (or/c boolean? void?) name : string? command : path-string? arg : path-string? mode : (or/c 'error 'result) = 'error
The mode argument determines how failure of the command is
handled—
procedure
(docker-copy #:name name #:src src #:dest dest [ #:mode mode]) → (or/c boolean? void?) name : string? src : path-string? dest : path-string? mode : (or/c 'error 'result) = 'error
The mode argument determines how failure of the copy is
handled—