View Source Dagger.Host (dagger v0.10.3)

Information about the host environment.

Link to this section Summary

Functions

Accesses a directory on the host.

Accesses a file on the host.

A unique identifier for this Host.

Creates a service that forwards traffic to a specified address via the host.

Sets a secret given a user-defined name and the file path on the host, and returns the secret.

Creates a tunnel that forwards traffic from the host to a service.

Accesses a Unix socket on the host.

Link to this section Types

@type t() :: %Dagger.Host{client: term(), selection: term()}

Link to this section Functions

Link to this function

directory(host, path, optional_args \\ [])

View Source
@spec directory(t(), Dagger.String.t(), keyword()) :: Dagger.Directory.t()

Accesses a directory on the host.

required-arguments

Required Arguments

  • path - Location of the directory to access (e.g., ".").

optional-arguments

Optional Arguments

  • exclude - Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
  • include - Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
@spec file(t(), Dagger.String.t()) :: Dagger.File.t()

Accesses a file on the host.

required-arguments

Required Arguments

  • path - Location of the file to retrieve (e.g., "README.md").
@spec id(t()) :: {:ok, Dagger.HostID.t()} | {:error, term()}

A unique identifier for this Host.

Link to this function

service(host, ports, optional_args \\ [])

View Source
@spec service(t(), [Dagger.PortForward.t()], keyword()) :: Dagger.Service.t()

Creates a service that forwards traffic to a specified address via the host.

required-arguments

Required Arguments

  • ports - Ports to expose via the service, forwarding through the host network.

If a port's frontend is unspecified or 0, it defaults to the same as the backend port.

An empty set of ports is not valid; an error will be returned.

optional-arguments

Optional Arguments

  • host - Upstream host to forward traffic to.
Link to this function

set_secret_file(host, name, path)

View Source
@spec set_secret_file(t(), Dagger.String.t(), Dagger.String.t()) :: Dagger.Secret.t()

Sets a secret given a user-defined name and the file path on the host, and returns the secret.

The file is limited to a size of 512000 bytes.

required-arguments

Required Arguments

  • name - The user defined name for this secret.
  • path - Location of the file to set as a secret.
Link to this function

tunnel(host, service, optional_args \\ [])

View Source
@spec tunnel(t(), Dagger.Service.t(), keyword()) :: Dagger.Service.t()

Creates a tunnel that forwards traffic from the host to a service.

required-arguments

Required Arguments

  • service - Service to send traffic from the tunnel.

optional-arguments

Optional Arguments

  • ports - Configure explicit port forwarding rules for the tunnel.

If a port's frontend is unspecified or 0, a random port will be chosen by the host.

If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.

If ports are given and native is true, the ports are additive.

  • native - Map each service port to the same port on the host, as if the service were running natively.

Note: enabling may result in port conflicts.

@spec unix_socket(t(), Dagger.String.t()) :: Dagger.Socket.t()

Accesses a Unix socket on the host.

required-arguments

Required Arguments

  • path - Location of the Unix socket (e.g., "/var/run/docker.sock").