You can use this container to use commonly used cli tools without installing them in your machine
useful for:
Demo

pull and run the container
docker run -it buonzz/workspace /bin/bash
this will fetch the image, run the container, and log you inside the container -- now all the tools is available in front of you by just executing that simple command
NOTE: for Windows users, you might need to prepend "winpty" on each of these commands.
winpty docker run -it buonzz/workspace bash
the following commands will mount your current working directory ($(pwd)) to a path inside the container (/var/www), then executes the commands passed in bash command. The effect is, the bash commands is being executed as if you are executing it in your host machine.
NOTE: for Windows users using Git bash, you should replace the $(pwd) with /${PWD}
Fetch composer dependencies
in any folder on which you have composer.json file, just execute the following:
docker run -v $(pwd):/var/www buonzz/workspace bash -c "composer install --no-interaction"
this will run the workspace, and execute composer install command inside. The resulting vendor folder is generated in the current folder.
install or update a composer package
docker run -v $(pwd):/var/www buonzz/workspace bash -c "composer install elasticsearch/elasticsearch"
or
docker run -v $(pwd):/var/www buonzz/workspace bash -c "composer update elasticsearch/elasticsearch"
Fetch npm packages (using npm)
in any folder on which you have package.json file, just execute the following:
docker run -v $(pwd):/var/www buonzz/workspace bash -c "npm install"
Fetch npm packages (using yarn)
in any folder on which you have package.json file, just execute the following:
docker run -v $(pwd):/var/www --user=laradock buonzz/workspace bash --login -c "yarn install"
run python command
docker run -v $(pwd):/var/www buonzz/workspace bash -c "python -c \"for r in range(10): print 'hello'\""
Bower
docker run -v $(pwd):/var/www buonzz/workspace bash -c "bower --version"
Gulp
docker run -v $(pwd):/var/www buonzz/workspace bash -c "gulp --version"
run mysql commands
docker run -v $(pwd):/var/www buonzz/workspace bash -c "mysql -u root -psecret -h put_hostname_here -e \"SELECT * FROM users\" > users.sql"
this will connect to the put_hostname_here mysql server, execute the sql query and dump the result to the current directory in the host.
Java
docker run -v $(pwd):/var/www buonzz/workspace bash -c "java -version"
Ruby
docker run -v $(pwd):/var/www buonzz/workspace bash -c "ruby -v"
Jekyll
docker run -v $(pwd):/var/www -p 4000:4000 buonzz/workspace bash -c "jekyll serve"
Content type
Image
Digest
Size
793.2 MB
Last updated
almost 8 years ago
docker pull buonzz/workspace