Skip to content

🐳 LocalEnv - Local Containerized Environment supports various languages.

License

Notifications You must be signed in to change notification settings

tungbq/LocalEnv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐳 LocalEnv

Local Containerized Environment supports various programming languages

Introduction πŸ‘‹

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.

Prerequisites πŸ”“

Before you begin, ensure that you have Docker installed. It's also helpful to have a basic understanding of Docker concepts.

Key Features πŸš€

  • 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.

Demo πŸ”₯

# 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	

Supported Environment πŸš€

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

Usage πŸ“–

To use the LocalEnv tool, follow these steps:

1. Clone

Clone the repository:

git clone https://github.com/tungbq/LocalEnv.git
cd LocalEnv

2. Configure

Configure your environment:

  • Edit the config.yaml file to specify the details of the environment you want to use, for example:
# File: ./config.yaml
python:
  image: 'python:3.12'
  default_container_name: 'pyEnv'
  base_command: 'python'

3. Code

Write your own code under env, for example:

4. Run

Run a script:

  • Use the following command format to run your script within the containerized environment:
./localenv <language> <script_path>

For example, to run a Python script:

./localenv python env/python/demo.py

5. More

Refer to the user guide for detailed instructions on using each supported environment. Links to the user guides are available in the table above.

Troubleshooting

Contributing

  • See: CONTRIBUTING.md
  • If you find this repository helpful, kindly consider showing your appreciation by giving it a star ⭐ Thanks! πŸ’–
  • Feel free to open a new issue if you encounter the LocalEnv bug or want to request more content about LocalEnv
  • Submit a new issue (πŸ›) if you encounter the bug/error when using this repo

Releases

No releases published

Packages

No packages published

Languages