Giter VIP home page Giter VIP logo

dpx - Docker Process Executer

Run any executable inside container on your machine in few seconds (e.g. go, node, ruby, python, elixir, etc.).

Getting started

  1. Intialize new container from any docker images (e.g. golang).

This will create dpx.yml config file in current directory.

dpx init golang:1.16-alpine
  1. Set $PATH variable.
eval $(dpx path) 
  1. Link executable file and have fun!
# Create a link inside `.dpx/bin` directory
dpx link go

# Run any `go` command
go mod init app

Installation

macOS

dpx is available on macOS via Homebrew.

brew install dpx/dpx/dpx

Others

Packaged binaries can be downloaded from the releases page.

Usage

dpx exec [cmd]

Execute a program inside container (equivalent to docker exec -it [container] [cmd]).

Default configurations

By default, all commands will inherit default configuration from defaults: section in dpx.yml file.

defaults:
  envs:
    - MODE=test
  user: docker
  workdir: /app

This will make every command that gets executed via dpx exec [cmd] inherits those settings.

Per-command configurations

Each command can also be configured with pre-define options.

envs set ENV before running a command.

commands:
  node:
    envs:
      - NODE_ENV=test

dpx exec node will be evaluated to NODE_ENV=test node in container.

options add options to your command.

commands:
  ps:
    options: aux

dpx exec ps will add aux options to ps command (e.g. ps aux).

workdir set current working dir for a command.

commands:
  ls:
    workdir: /app

dpx exec ls will be evaulated to $ /app ls

Working with code editor, etc.

  • Visual Studio Code - Once you've setup $PATH variable. Launch vscode from current directory with code . command.

This will allow vscode to search for executable file under $PATH variable.

Commands

COMMANDS:
   init, i   Setup docker image and create dpx.yml config file
   start, s  Start container from config
   stop      Stop a running container
   exec, x   Execute a command in container
   link, l   Link to an executable/binary inside container
   ps        Print current container ID
   path      Print $PATH variable
   help, h   Shows a list of commands or help for one command

dpx's Projects

dpx doesnโ€™t have any public repositories yet.

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.