phpdock is a languages's version manager, powered with Docker, using principally the Dockerhub
langdock is inspired in rbenv, goenv and pyenv
- Clone langdock into ~/.langdock
$ git clone git@github.com:lucasdc6/langdock.git ~/.langdock
- Add the envoiroment variable LANGDOCKPATH and the directory $LANGDOCKPATH/bin to
$PATH
$ echo 'export LANGDOCKPATH=$HOME/.langdock' >> ~/.bash_profile
$ echo 'export PATH="$HOME/.langdock/bin:$PATH"' >> ~/.bash_profile
- Add the eval sentence to the bashrc
$ echo 'eval "$(langdock init -)' >> ~/.bash_profile
Ubuntu desktop note: Modify your ~/.bashrc
instead of ~/.bash_profile
Zsh note: Modify ~/.zshrc
- Restart your shell so that PATH changes take effect.
Availables scripts commands:
- Set a global language version (shell restart is needed)
- Set a local language version (shell restart isn't needed)
- Install docker language images
- List installed versions
- List availables versions on docker repositories
Manage availables repositories:
- List repositories
- Add repository
- Delete repository
The availables repositories is stored in a file in etc
directory
Repositories file use complete docker repositories name.
Add a repository
$ langdock repositories --add <COMPLETE_REPOSITORY_NAME>
Eg: Add the oficial php repository (added by default)
$ phpdock repositories --add php
The script doesn't install binaries!
The script pull docker images and reference those images via files and
envoiroment varialbes, used by the commands
(see 'commands' directory)
Variable | Description |
---|---|
LANGDOCK_DEBUG |
Enable debug mode |
LANGDOCKPATH |
Root path to repository |
- File modified by the command
<langdock> global <version>
- Stored at
$LANGDOCKPATH/etc/<language-name>/version
- Low precedence
- File modified by the command
<langdock> local <version>
- Stored in the command's context execution (
.<language-name>-version
) - Medium precedence
- Via envoiroment variables modified by the command
<langdock> shell <version>
- High precedence
Add a new language version:
-
Firts, search the complete docker image name (repository+tag)
Show all availables docker images in known repositories:
<langdock> install --list # docker image's list
-
Once identified the docker image, send it as argument to
<langdock> install
Eg, we need the php 7.2.0 from oficial repositoryphpdock install php:7.2.0-cli
If you know the php version needed for the project, you can create a file named
.<language>-version
and put the version (only the number).
This make easiest to export the project.
Once created the file, run the follow:
<langdock> install
This show you a selectable menu with all docker images that match the version specified