2 Managing Docker Containers and Images
Added in version 1.3 of package remote-shell-lib.
Builds a new Docker image tagged by name, using the
content directory to create the image. The content
directory should contain a file named "Dockerfile".
Returns the identity of a Docker image tagged by name,
returning #f if no such image exists.
Removes the Docker image indicated by name (or, at least,
removes the tagged reference, but the image may persist if it has
other names).
(docker-create | | #:name name | | | | | | | #:image-name image-name | | | | | | [ | #:network network | | | | | | | #:volumes volumes | | | | | | | #:replace? replace?]) | | → | | string? |
|
name : string? |
image-name : string? |
network : (or/c #f string?) = #f |
|
replace? : boolean? = #f |
Creates a Docker container as name as an instance of
image-name. If replace? is true, then any existing
container using the name is stopped (if running) and removed, first.
The newly created container is not running.
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.
Returns the identity of a Docker container name, returning
#f if no such container exists.
Determines whether the Docker container name (which must
exist) is currently running.
Removes the Docker container name, which must exist and must
not be running.
Starts the Docker container name, which must exist and must
not be running.
Stops the Docker container name, which must exist and must be
running.
Executes command with args on the Docker container
name, which must exist and be running.
The mode argument determines how failure of the command is
handled—either because the command exits with failure on the
container or due to a problem accessing the container—as well as the
return value for success. The 'error mode raises an exception
for failure and returns (void) for success, while
'result mode returns a boolean indicating whether the command
was successful.
Copies a file to or from the Docker container name. One of
src or dest should refer to a file on the host
machine, and the other should be a string prefixed with the
name and ":" to indicate a path on the container.
The mode argument determines how failure of the copy is
handled—either due to path problems or a problem accessing the
container—as well as the return value for success. The
'error mode raises an exception for failure and returns
(void) for success, while 'result mode returns a
boolean indicating whether the copy was successful.