Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koalalorenzo/docker-aliases

👾 Run commands inside docker containers to keep your OS untouched using bash alias
https://github.com/koalalorenzo/docker-aliases

Last synced: 12 days ago
JSON representation

👾 Run commands inside docker containers to keep your OS untouched using bash alias

Awesome Lists containing this project

README

        

# docker-aliases
Run commands inside docker containers to keep your OS untouched using bash alias. The aliases are saved into the file called "aliases.sh", and it will use, mount files and open ports in a container instead of using the one in the host/main operative system.

The main concept is to run a comand using its docker container/image like that:

docker run -it --rm -v $(pwd):/directory -w /directory node node

But this repository contains some aliases to "replace" the main command:

alias node="docker run -it --rm -v $(pwd):/directory -w /directory node node"
alias npm="docker run -it --rm -v $(pwd):/directory -w /directory node npm"
# then run
node --version
npm --version

You can use these commands:

* ruby
* rails
* php
* node
* npm
* coffee ( coffeescript )
* python ( python 3.4 )
* python2.7
* django-admin.py
* nginx
* redis-cli
* redis-server
* postgres
* psql
* ... more! See [aliases.sh](aliases.sh) file!

## How to use
Add, in your ~/.bash_profile file this line, replacing ~/PATH_OF_REPOSITORY with the PATH/directory of this repository.

source ~/PATH_OF_REPOSITORY/aliases.sh

And then it will start using these commands, inside a docker container each time you run any of them.

**Note**: Some commands may require some more configuration in order to work properly. Feel free to create a pull request or open an issue in case you find a solution!