stack-1.6.5: The Haskell Tool Stack

Safe HaskellNone



Run commands in Docker containers



cleanup :: HasConfig env => CleanupOpts -> RIO env () Source #

Clean-up old docker images and containers.

dockerCleanupCmdName :: String Source #

Command-line argument for docker cleanup.

dockerCmdName :: String Source #

Command-line argument for "docker"

dockerPullCmdName :: String Source #

Command-line argument for docker pull.

entrypoint :: (MonadUnliftIO m, MonadLogger m, MonadThrow m) => Config -> DockerEntrypoint -> m () Source #

The Docker container "entrypoint": special actions performed when first entering a container, such as switching the UID/GID to the "outside-Docker" user's.

preventInContainer :: MonadIO m => m () -> m () Source #

Error if running in a container.

pull :: HasConfig env => RIO env () Source #

Pull latest version of configured Docker image from registry.

reexecWithOptionalContainer :: HasConfig env => Maybe (Path Abs Dir) -> Maybe (RIO env ()) -> IO () -> Maybe (RIO env ()) -> Maybe (RIO env ()) -> RIO env () Source #

If Docker is enabled, re-runs the currently running OS command in a Docker container. Otherwise, runs the inner action.

This takes an optional release action which should be taken IFF control is transferring away from the current process to the intra-container one. The main use for this is releasing a lock. After launching reexecution, the host process becomes nothing but an manager for the call into docker and thus may not hold the lock.

reset :: (MonadIO m, MonadReader env m, HasConfig env) => Maybe (Path Abs Dir) -> Bool -> m () Source #

Remove the project's Docker sandbox.

reExecArgName :: String Source #

Command-line option for --internal-re-exec-version.

data StackDockerException Source #

Exceptions thrown by Stack.Docker.



Docker must be enabled to use the command.


Command must be run on host OS (not in a container).

InspectFailedException String

docker inspect failed.

NotPulledException String

Image does not exist.

InvalidCleanupCommandException String

Input to docker cleanup has invalid command.

InvalidImagesOutputException String

Invalid output from docker images.

InvalidPSOutputException String

Invalid output from docker ps.

InvalidInspectOutputException String

Invalid output from docker inspect.

PullFailedException String

Could not pull a Docker image.

DockerTooOldException Version Version

Installed version of docker below minimum version.

DockerVersionProhibitedException [Version] Version

Installed version of docker is prohibited.

BadDockerVersionException VersionRange Version

Installed version of docker is out of range specified in config file.


Invalid output from docker --version.

HostStackTooOldException Version (Maybe Version)

Version of stack on host is too old for version in image.

ContainerStackTooOldException Version Version

Version of stack in container/image is too old for version on host.


Can't determine the project root (where to put docker sandbox).


docker --version failed.


Using host stack-exe on unsupported platform.

DockerStackExeParseException String

stack-exe option fails to parse.