Code Monkey home page Code Monkey logo

ldc's Introduction

LDC; Local Docker Compose

ldc is a development tool for running development environments inside docker.

Installation

git clone [email protected]:kitware/ldc.git
cd ldc

# Have a look at your path to pick somewhere you can install ldc
echo $PATH

# Symlink this script into place, choosing a parent directory from PATH
ln -s $(pwd)/ldc.sh /usr/local/bin/ldc

# test installation
ldc

Now, you can git pull to update.

Usage

ldc generally wraps docker-compose, but it is aware of a particular directory structure and provides some nice shortcuts.

  • ldc looks in ./docker and ./devops by defailt
  • override LDC_BASE_DIR in .env if your docker-compose directory is different.
.
├── docker
│  ├── .env
│  ├── docker-compose.dev.yml
│  └── docker-compose.yml
├── {...project files}
├── .env
└── README.md

Then, to get up and running, you will typically do something like this:

# ldc only works from the project root
cd project_directory

# start docker-compose in detached mode
ldc up -d

# swap out whatever you're ready to work on with a development container
ldc dev up $service_name

Advanced usage

LDC just forwards commands to docker-compose and cleverly includes/excludes docker-compose.yml files.

ldc [extensions...] args

where extensions is 0 or more docker-compose.{name}.yml names to include.

ldc dev local up -d
# ... would be the same as ...
pushd ${LDC_BASE_DIR} && docker-compose \
  -f docker-compose.yml \
  -f docker-compose.dev.yml \
  -f docker-compose.local.yml \
  up -d && popd

If docker-compose.local.yml doesn't exist (for example), ldc would understand that argument to be intended as passing to docker-compose, and docker-compose would throw an error.

Use case

I created this tool primarily as a front-end developer who sometimes needs to modify backend code. For me, the cost of learning to set up someone else's development environment is significantly greater than the cost of dealing with the rigidity of this style of dev environment.

It's often much easier to document a dev setup with this tool than to write detailed docs for containerless setups, such as python virtual environments, where env variables, provision scripts, and dependency concerns are involved.

Usage with Girder 4

ldc generally works well with Girder 4 projects.

ldc's People

Contributors

subdavis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.