0.5.1 • Published 2 years ago

@allanavelar/local-docker-dev v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Table of contents

Quick start

local-docker-dev is a Docker-based tool to allow developers running app maintenance scripts inside containers, without writing a single line of Dockerfile. This is useful specially to run command-line tools, you won't need to have your own docker files to do that.

When you run local-docker-dev [IMAGE] [COMMAND] in your current directory, it will mount it as delegated volume, together with some of your $HOME files(*) and folders needed to run tasks like git push, npm publish, composer install, etc. which usually require credentials.

() From your $HOME, it only mounts the following (read-only): ~/.npmrc, ~/.composer/auth.json, ~/.gitconfig, ~/.gitignore_global*

Setup

You can clone this repository and run bin/local-docker-dev-init, then you will have to manually config the bin directory in your $PATH variable to have local-docker-dev available everywhere.

Alternatively, if you have node installed in your OS, you can install it globally with npm.

npm i -g @allanavelar/local-docker-dev && \
local-docker-dev-init

The Docker images are built by you, so you can customize this project to your needs and run local-docker-dev-init every time you need.

Supported Languages

Node & npm:

  • node
  • node:15
  • node:16, node:latest, node
  • npm (runs on node:latest)

PHP & composer:

  • php
  • php:7
  • php:7-xdebug
  • php:8, php:latest, php
  • php:8-xdebug
  • composer (runs on php:latest)

Go (planned):

  • go
  • go:1.15
  • go:1.16
  • go:latest

Usage

# Usage template:
local-docker-dev [LANG]:[VERSION] [COMMAND] [...PARAMETERS]
# Examples:
local-docker-dev node:16 node --version
local-docker-dev node npm install
local-docker-dev npm install

local-docker-dev php:8 php --ini
local-docker-dev php composer install
local-docker-dev composer install

# Running phpunit with code coverage:
local-docker-dev php:7-xdebug XDEBUG_MODE=coverage vendor/bin/phpunit

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

Moreover, all HTML and CSS should conform to the Code Guide, maintained by Main author.

Editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at https://editorconfig.org/.

Creators

Allan Avelar
▲▼ Allan Avelar ۞

Copyright and license

Code released under the MIT License.

Enjoy :metal: