🐳 LocalEnv - Local Containerized Environment supports various languages.
APACHE-2.0 License
LocalEnv is a tool designed for local development, allowing you to execute code in multiple languages without installing numerous tools on your PC. With Docker as the only prerequisite, you can seamlessly run code in various environments.
Before you begin, ensure that you have Docker installed. It's also helpful to have a basic understanding of Docker concepts.
Quickly write and run code: LocalEnv allows you to rapidly write and execute code in containerized environments locally.
localenv script: The repository includes a convenient localenv
script that simplifies the execution of code in different languages within Docker containerized environments.
env folder: Contains the code and document for each supported language.
config.yaml file: This config file allows users to configure their target environment settings easily. This includes specifying Docker images, default container names, and base commands for each language.
# Clone LocalEnv repository
git clone https://github.com/tungbq/LocalEnv.git
cd LocalEnv
# Execute python code
./localenv python env/python/demo.py
# Execute javascript code
./localenv javascript env/javascript/demo.js
Current support languages in below table
Language | Quick Start | User guide | Image |
---|---|---|---|
Python | ./localenv python env/python/demo.py |
python | Find |
Powershell | ./localenv powershell env/powershell/demo.ps1 |
powershell | Find |
Groovy | ./localenv groovy env/groovy/demo.groovy |
groovy | Find |
Javascript | ./localenv javascript env/javascript/demo.js |
javascript | Find |
Golang | ./localenv golang env/golang/demo.go |
go | Find |
Java | ./localenv java env/java/demo.java |
java | Find |
To use the LocalEnv tool, follow these steps:
Clone the repository:
git clone https://github.com/tungbq/LocalEnv.git
cd LocalEnv
Configure your environment:
# File: ./config.yaml
python:
image: 'python:3.12'
default_container_name: 'pyEnv'
base_command: 'python'
Write your own code under env, for example:
Run a script:
./localenv <language> <script_path>
For example, to run a Python script:
./localenv python env/python/demo.py
Refer to the user guide for detailed instructions on using each supported environment. Links to the user guides are available in the table above.