Git Product home page Git Product logo

dcw's Introduction

dcw dcw logo Build Status

dcw is Docker Compose Wrapper to simplify everyday dev work with containers.

Why dcw?

To sum up, do you prefer to run this kind of command when you localy develop some service on your local machine:

docker-compose --file path/to/your/docker-compose.yml run --no-deps --service-ports \
--rm my-service my-service-command

or simply use this shorthand syntax:

dcw -p my-service-command

Requirements

dcw logo Docker Engine dcw logo Docker Compose

Installation

curl -o /usr/local/bin/dcw -fsSL https://github.com/rezzza/dcw/raw/master/dcw \
&& chmod a+x /usr/local/bin/dcw

Usage


Usage: dcw [OPTIONS] CMD

  A docker compose wrapper to simplify everyday dev work with containers

    -f, --file             Path to the docker compose file
    -s, --service          Name of docker compose service to run
    -p, --service-ports    Run command with the service's ports enabled and mapped
    -r, --run-options      Extra docker-compose run options (quote them)
    -h, --help             Display this usage description
    -v, --verbose          Display executed docker-compose command
    -d, --dry-run          Display docker-compose command aims to be executed
    -V, --version          Return dcw version

  You can also configure following environment variables, either putting then
  into a .dcw file in the current execution path of the command OR by
  exporting them.

    DCW_COMPOSE_FILE_PATH
    DCW_COMPOSE_DEFAULT_RUN_OPTIONS
    DCW_COMPOSE_SERVICE

  Most useful use cases examples:

    Run a simple command
    $ dcw ls /

    Run a command with some options
    $ dcw -- ls -lha /

    Run a command on a service which need to bind ports
    $ dcw -p npm start /

Advanced usage

When you're used to develop on some project repository, you probably want preset some options to not repeat yourself typing commands.

So you can simply create a .dcw file at the root of your repository.

.dcw file example:

cat > .dcw <<EOL
DCW_COMPOSE_FILE_PATH=docker/dev.myapp.mycompany/docker-compose.yml
DCW_COMPOSE_DEFAULT_RUN_OPTIONS="--rm --no-deps"
DCW_COMPOSE_SERVICE="app"
EOL

dcw's People

Contributors

armandabric avatar cuonglm avatar senk avatar shouze avatar

Watchers

 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.