Skip to content

ScientificC/langdock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

langdock

phpdock is a languages's version manager, powered with Docker, using principally the Dockerhub

langdock is inspired in rbenv, goenv and pyenv

Contents

Install

Local

  1. Clone langdock into ~/.langdock
$ git clone git@github.com:lucasdc6/langdock.git ~/.langdock
  1. 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
  1. 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

  1. Restart your shell so that PATH changes take effect.

Use

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 repositories

Add a repository

  $ langdock repositories --add <COMPLETE_REPOSITORY_NAME>

Eg: Add the oficial php repository (added by default)

  $ phpdock repositories --add php

Environment variables

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

Version files

Global version

  • File modified by the command <langdock> global <version>
  • Stored at $LANGDOCKPATH/etc/<language-name>/version
  • Low precedence

Local version

  • File modified by the command <langdock> local <version>
  • Stored in the command's context execution (.<language-name>-version)
  • Medium precedence

Shell version (Comming soon!)

  • Via envoiroment variables modified by the command <langdock> shell <version>
  • High precedence

Install language version

Manual

Add a new language version:

  1. Firts, search the complete docker image name (repository+tag)

    Show all availables docker images in known repositories:

     <langdock> install --list
     # docker image's list
  2. Once identified the docker image, send it as argument to <langdock> install Eg, we need the php 7.2.0 from oficial repository

     phpdock install php:7.2.0-cli

Using .language-version file

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%