TF(1)

NAME
tf - launch a container on 20ft.nz

SYNOPSIS
tf [-h] [--location x.20ft.nz] [--local y.local] [[-e ENV=value] ... ] [[-f src:dest] ... ] [[-m uuid:/mount/point] ... ] [[-p local:remote] ... ] [[-r remote:local] ... ] [-c script.sh | -z] [-w [subdomain.]wip.my.com[:www.my.com[:certname]]] [--ssh port | -s] [-v | -q] [-i] source [args ... ]

DESCRIPTION
tf launches containers or scripts on 20ft.nz: passes environment variables, copies pre-boot files, mounts persistent volumes, port maps onto the container and selects a starting command; creates an ssh/sftp server, and changes log verbosity. If the source name is a file (with the .py extension) that implements tf_exec in Python, the function is called.
   def tf_exec(location, node, environment, portmap, preboot, volumes, args): Otherwise the source is assumed to be a docker id in either the 'hex' or 'name' form; or '.' implies the most recently added image in the local docker daemon.

OPTIONS

-h, --help
    Present cli help.

--location x.20ft.nz
    Use an (optional) non-default location (fqdn).

--local y.local
    An optional (local) ip for the broker.

-e ENV=value
    Add an environment variable to the launch context.

-f src:dest
    Before boot copy the source file into the destination directory.

-m uuid:/mount/point
    Mount the volume 'uuid' at the given mount point.

-p localport:remoteport
    Create a TCP tunnel between localhost and the container.

-p remoteport:localport
    Create a single use TCP tunnel between the container and localhost (an aid for debugging, not for production).

-c  Choose an alternate entrypoint.

-w [subdomain.]wip.my.com[:www.my.com[:certname]]
    Publish port 80 of the container to a web endpoint. Publishing to a subdomain is enabled by creating a wildcard DNS entry (i.e. *.wip). Applications which expect a given 'Host' header can have this set with the rewrite (second) option. To host behind ssl pass a certificate name where tf will look for certname.crt and certname.key. Intermediate certs will need to be cat'ed onto the end of the main certificate.

--ssh port
    Launch the container, then start a shell and wrap it with an ssh session on the specified port (pass:root, blank password).

-s  Short for "--ssh 2222"

-z  Launch the container but don't run the entrypoint or command (runs 'sleep').

-i  Run interactively (connects stdin and stdout).

-v  Verbose logging (level DEBUG).

-q  Logging is not configured.

EXAMPLES

Launch the most recently built Docker image and map local port 8080 to remote port 80.

    tf -p 8080:80 .

Launch the stock nginx image mapping port 8080 to 80, with a pre-existing volume for the http content and the ability to ssh/sftp into the container.

    tf -p 8080:80 -m UUID1234:/usr/share/nginx/html nginx

Run a script passing "prod" as an argument.

    tf our_script prod

Run a script passing "--prod" as an argument.

    tf our_script -- --prod