Skip to content

Latest commit

 

History

History
70 lines (45 loc) · 2.39 KB

usage.md

File metadata and controls

70 lines (45 loc) · 2.39 KB

dex Usage

At its heart, dex manages 'dexecutables' -- runtime scripts that execute containerized applications. The Dockerfiles making up these applications are managed in source repositories.

source repositories

Dex consults source repositories for the Dockerfile to build application images from -- similar to how yum and apt consult package sources. Thus, applications available to dex are dictated by source repository checkouts.

Source Repositories are defined one-per-line in $DEX_HOME/sources.list as <name> <url>. URLs may point to the remote URL or local path of a git repository. Each repository must have a dex-images/ tree containing images.

Use dex repo to manage source repositories.

sources.list example - repository example

⭐ Repository checkouts are performed once when added. Use dex repo pull to refresh checkout(s), or pass the --pull flag to dex run|ls|install|etc commands to perform a checkout on-the-fly.

environmental variables

Use environmental variables to override default default command and container runtime behavior.

dex command

variables effecting command behavior.

Here's an example overriding the bin directory and prefix.

DEX_BIN_DIR=~/bin/ DEX_BIN_PREFIX=acme- dex install ag
# ^^^ ag installed to ~/bin/acme-ag
var default description
DEX_BIN_DIR $DEX_HOME/bin dexecutable installation target directory
DEX_BIN_PREFIX d dexecutable installation prefix
DEX_HOME ~/.dex dex workspace, where checkouts and sources.list are kept.
DEX_NAMESPACE dex/v1 prefix used when tagging image builds
DEX_NETWORK true enables network fetching
DEX_RUNTIME v1 runtime api version

dex runtime

variables effecting runtime behavior.

Here's an example overriding the entrypoint of an installed image.

dex install --global ansible
DEX_DOCKER_ENTYPOINT=bash ansible
$
# ^^^ ...we're now in the ansible container's bash shell...

See v1 runtime variables for a complete list.

use cases

WIP

as a bootstrap

see dex and a "modern" bootstrap

as a dependency manager

wrapping an environment