Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dip

> DevOps
Open source

The dip is a CLI dev–tool that provides native-like interaction with a Dockerized application.

1.3K stars0 likes1 views
WebsiteGitHub

About

The dip is a CLI dev–tool that provides native-like interaction with a Dockerized application.

The dip is a CLI dev–tool that provides native-like interaction with a Dockerized application. It gives the feeling that you are working without using mind-blowing commands to run containers.

Presentations and examples

  • Local development with Docker containers
  • Dockerized Ruby on Rails application
  • Dockerized Node.js application: one, two
  • Dockerized Ruby gem
  • Dockerizing Ruby and Rails development
  • Reusable development containers with Docker Compose and Dip

Quick start with AI

dip-skill helps you quickly configure a dip environment for your project. It detects the tech stack and bootstraps dip.yml, compose files, and Dockerfiles.

bash
npx skills add kalashnikovisme/dip-skill

Installation

bash
gem install dip

Integration with shell

Dip can be injected into the current shell so that interaction commands (and compose, up, stop, down, build, provision) become available without the dip prefix. Bash, ZSH, and Fish are supported.

Add the matching line to your shell startup file so the integration is loaded in every session:

bash
# Bash — ~/.bashrc or ~/.bash_profile
eval "$(dip console)"
bash
# ZSH — ~/.zshrc
eval "$(dip console)"
fish
# Fish — ~/.config/fish/config.fish
dip console | source

The target shell is autodetected from the $SHELL environment variable, so the snippets above work as-is. If autodetection is wrong (for example, you run Fish but $SHELL still points to Bash), force the dialect explicitly:

bash
eval "$(dip console --shell zsh)"     # Bash / ZSH
dip console --shell fish | source     # Fish

--shell accepts bash, zsh, or fish (bash and zsh produce the same POSIX output).

IMPORTANT: Beware of possible collisions with local tools. One particular example is supporting both local and Docker frontend build tools, such as Yarn. If you want some developer to run yarn locally and other to use Docker for that, you should either avoid adding the yarn command to the dip.yml or avoid using the shell integration for hybrid development.

After that we can type commands without dip prefix. For example:

bash
 *any-args
compose *any-compose-arg
up 
ktl *any-kubectl-arg
provision

When we change the current directory, all shell aliases are automatically removed. When we enter a directory that has a dip.yml file (in it or in a parent), the aliases are renewed. This is wired through the shell's directory-change hook — chpwd_functions on ZSH, a cd/pushd/popd wrapper on Bash, and a --on-variable PWD handler on Fish. The hook resolves the applicable dip.yml itself (no dip process involved) and only actually reloads when that path changes, so cding around inside the same project doesn't re-run dip on every prompt.

Also, in shell mode Dip tries to determine manually passed environment variables. For example:

bash
VERSION=20180515103400 rails db:migrate:down

Once the startup snippet is in place, the integration is applied automatically every time you open your terminal.

How it works

dip console prints a bootstrap script that defines three helpers:

  • dip_inject — evaluates dip console inject, which emits one shell function per interaction command plus the built-in compose/up/stop/down/build/provision wrappers. An interaction command whose name collides with a shell builtin/keyword (jobs, test, read, set, …) is skipped, with a warning on stderr — run it as dip instead, or rename it.
  • dip_clear — removes the functions previously injected (regenerated on every inject so it always matches the current dip.yml).
  • dip_reload — runs dip_clear then dip_inject; also bound to the directory-change hook, which calls it only when the resolved dip.yml path actually changed.

The bootstrap also exports DIP_SHELL=1, DIP_EARLY_ENVS (the list of variables present at load time, used to detect manually passed env vars), and DIP_PROMPT_TEXT (ⅆ). On ZSH with the agnoster theme, DIP_PROMPT_TEXT is added as a prompt segment; other shells and themes are left untouched.

You can force a reload at any time by running dip_reload (useful after editing dip.yml).

Usage

bash
dip --help
dip SUBCOMMAND --help

dip.yml

The configuration is loaded from dip.yml file. It may be located in a working directory, or it will be found in the nearest parent directory up to the file system root. If a dip.override.yml file exists nearby, it will be merged into the main config.

Also, in some cases, you may want to change the default config path by providing an environment variable DIP_FILE.

Below is an example of a real config. The schema is defined in schema.json and can be validated with dip validate. Also, you can check out examples at the top.

…

preflight is an array of shell commands that dip runs before any command that touches a running container or cluster: dip compose ... (and its aliases dip up, dip build, dip stop, dip down), dip ktl ..., and dip run ... (including the interaction shorthand dip ). If any command exits non-zero, dip aborts before the underlying operation runs. Useful for verifying credentials are present, required files exist, env vars are set, etc.

Not triggered by dip down --all (cross-project teardown), dip ssh, dip infra, or dip provision.

Predefined environment variables

$DIP_OS

Current OS name (e.g. linux, darwin, freebsd, and so on). Sometimes it may be useful to have one common docker-compose.yml and OS-dependent Compose configs.

$DIP_WORK_DIR_REL_PATH

Relative path from the current directory to the nearest directory where a Dip's config is found. It is useful when you need to mount a specific local directory to a container along with ability to change its working dir. For example:

- project_root
  |- dip.yml (1)
  |- docker-compose.yml (2)
  |- sub-project-dir
     |- your current directory is here  --single-branch  --depth 1`.

Available CLI commands:

- `dip infra update` pulls updates from sources
- `dip infra up` starts all infra services
- `dip infra up -n kafka` starts a specific infra service
- `dip infra down` stops all infra services
- `dip infra down -n kafka` stops a specific infra service

### dip ktl

Run kubectl commands that are configured according to the application's dip.yml:

```sh
dip ktl COMMAND [OPTIONS]

STAGE=some dip ktl get pods

dip ssh

Runs ssh-agent container based on https://github.com/whilp/ssh-agent with your ~/.ssh/id_rsa. It creates a named volume ssh_data with ssh socket. An application's docker-compose.yml should contain the environment variable SSH_AUTH_SOCK=/ssh/auth/sock and connect the external volume ssh_data.

bash
dip ssh up

docker-compose.yml

yaml
services:
  web:
    environment:
      - SSH_AUTH_SOCK=/ssh/auth/sock
    volumes:
      - ssh-data:/ssh:ro

volumes:
  ssh-data:
    external:
      name: ssh_data

if you want to use non-root user you can specify UID like so:

dip ssh up -u 1000

This especially helpful if you have something like this in your docker-compose.yml:

yaml
services:
  web:
    user: "1000:1000"

dip validate

Validates your dip.yml configuration against the JSON schema. The schema validation helps ensure your configuration is correct and follows the expected format.

bash
dip validate

…

sh
dip console [--shell bash|zsh|fish]          # bootstrap script (default subcommand)
dip console inject [--shell bash|zsh|fish]   # just the command aliases
  • --shell (-s) selects the dialect: bash, zsh, or fish. When omitted, it is autodetected from $SHELL, falling back to POSIX (Bash/ZSH) output.
  • dip console is meant to be evaluated by your shell: eval "$(dip console)" for Bash/ZSH, dip console | source for Fish.
  • dip console inject is called internally by the bootstrap script (via dip_reload); you normally don't run it by hand. It only needs the interaction command names, so it skips full dip.yml schema validation — run dip validate (or any other dip command) to check the file against the schema.

Changelog

See CHANGELOG.md.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubybashclidockerdocker-compose

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理