MCPcopy Index your code
hub / github.com/benzaita/dockerized-cli

github.com/benzaita/dockerized-cli @v0.16.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.16.1 ↗ · + Follow
139 symbols 529 edges 33 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dockerized 🏗❤️

Easily Docker-ize your build/development environment and seamlessly run commands inside it.

dockerized is a tool for seamlessly executing commands in a container. It takes care of the details so you can run a command in a container as if it was running on your machine - just prepend any command with dockerized exec to have it run in the container.

See https://benzaita.github.io/dockerized-cli/index.html

Getting Started

Install dockerized:

$ pip install dockerized

Initialize your environment:

$ dockerized init
$ echo FROM python:3.9 > .dockerized/Dockerfile.dockerized

or use an example:

$ dockerized init --from https://github.com/benzaita/dockerized-example-python.git

Then run a command inside that environment:

$ dockerized exec python --version
...
Python 3.9.0

Or drop into an interactive shell inside the environment:

$ dockerized shell
# python --version
Python 3.9.0

Examples

See the examples wiki page.

Advanced Topics

FAQ

Why not docker run or docker exec?

Fair question! After all dockerized is just a wrapper for Docker. You can definitely use docker run or docker exec but there are a few details you'd have to take care of:

Rebuilding the Docker image: after changing the Dockerfile, you need to run docker build before running docker run again. When iterating on the Dockerfile this can become a pain.

With dockerized you just do dockerized exec.

Volumes and working directory: to allow the developer to run commands from arbitrary locations within the project, you probably want to mount the project root into the container. Manually running docker run -v $PWD:... one time and docker run -v $PWD/..:... another time, or adding some script to do this for you.

With dockerized you just do dockerized exec.

Running Docker Compose: almost every project has integration tests. Running them locally usually means running Docker Compose. Now you need to run docker-compose up before running docker run. Besides being annoying, see also "Port contamination" below.

With dockerized you just do dockerized exec.

"Port contamination": many people run their tests on the host, against dependencies (think PostgreSQL for example) running in containers. Since the tests need to access the PostgreSQL port, they expose this port to the host. When you are working on multiple projects these exposed ports start conflicting and you have to docker-compose stop one project before docker-compose start the other.

With dockerized you just do dockerized exec.

Core symbols most depended-on inside this repo

set_prepared
called by 10
dockerized/core/project.py
run
called by 9
dockerized/core/commands/exec.py
run
called by 8
dockerized/core/commands/init.py
execute_command
called by 6
dockerized/adapters/dockercompose.py
friendly_dockerized_errors
called by 6
dockerized/ui/cli.py
is_prepared
called by 5
dockerized/core/project.py
prepare_if_needed
called by 5
dockerized/core/project.py
setup_project_dir
called by 5
dockerized/test/__init__.py

Shape

Method 99
Class 25
Function 13
Route 2

Languages

Python100%

Modules by API surface

test_dockerized.py23 symbols
dockerized/adapters/environment.py12 symbols
dockerized/ui/cli.py11 symbols
dockerized/core/test_project.py10 symbols
dockerized/core/commands/test_init.py9 symbols
dockerized/adapters/dockercompose.py9 symbols
dockerized/core/project.py8 symbols
dockerized/core/config.py8 symbols
dockerized/adapters/test_dockercompose.py7 symbols
dockerized/test/__init__.py5 symbols
tasks.py3 symbols
dockerized/core/commands/shell.py3 symbols

For agents

$ claude mcp add dockerized-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact