This project provides a Dockerized environment to use LazyVim, an advanced Neovim configuration, along with essential developer tools.
- LazyVim: Predefined Neovim configuration to maximize productivity.
- Dockerized: Fully isolated and reproducible environment.
- bash with Oh My bash: Interactive shell with plugins and advanced customization.
- Included tools:
git
,lazygit
,fzf
,ripgrep
, among others. - Volume mounting: Direct access to your local files from the container.
- Persistent configuration: Configuration changes are retained between sessions.
This project uses a global version stored in the VERSION
file located in the root of the repository. The version is used during the Docker image build process and is embedded as metadata in the image.
- Open the
VERSION
file in the root of the project. - Update the version number (e.g., change
1.1.0
to1.2.0
). - Rebuild the Docker image using the
build.sh
script:
./build.sh
After building the image, you can verify the version embedded in the image by running:
docker inspect lazyvim | grep '"version"'
- Docker: Make sure Docker is installed on your system.
- Docker Compose: Required to manage the environment.
build.sh
: Builds and configures the entire environment.init.sh
: Access the container after exiting.destroy.sh
: Stops and removes the containers but keeps the volumes.
If the scripts do not have execution permissions, you can grant them using the following command, replacing <script-name>
with the script file you want to execute:
chmod +x ./<script-name>
For example, to grant execution permissions to build.sh
:
chmod +x ./build.sh
If you want to automate the installation process, run the following command. This will clone the repository, navigate to the project folder, grant execution permissions to the scripts, and build the environment:
git clone https://github.com/manghidev/lazyvim-docker.git && cd lazyvim-docker && chmod +x ./build.sh ./init.sh ./destroy.sh && ./build.sh
- Clone this repository:
git clone https://github.com/manghidev/lazyvim-docker.git
cd lazyvim-docker
- Build the environment using the
build.sh
script (Only the first time, or when you want to update the image, as it will erase everything and rebuild everything):
./build.sh
- If you need to re-enter or run the container again, use the
init.sh
script:
./init.sh
- To destroy the environment (along with the volumes), use the
destroy.sh
script:
./destroy.sh
- Edit files: Use LazyVim to edit your files directly from the container.
- Customize configuration: Modify the files in
/root/.config/nvim
to adjust LazyVim to your needs. - Persistence: Configuration changes are automatically saved thanks to the Docker volume.
You can edit the volumes in the docker-compose.yml
file to add a documents folder or a USB drive according to your needs. By default, the following configurations are included:
Mount the user's Documents directory on macOS inside the container:
- $HOME/Documents:/home/developer/Documents
If you are using Linux, you can mount the user's Documents directory:
- /home/user/Documents:/home/developer/Documents
To mount a USB drive on macOS, use the following configuration:
- /Volumes/sdb1:/home/developer/usb
If you need to mount a USB drive on Linux, use this configuration:
- /dev/sdb2:/home/developer/usb
If you want to add a specific directory where you store your projects, you can edit the docker-compose.yml
file and add a line like this:
- /path/to/your/project:/home/developer/projects
This will mount the /path/to/your/project
directory from your local system into the container at /home/developer/projects
.
You can modify these paths directly in the docker-compose.yml
file to adapt them to your operating system and specific needs. Make sure the local paths exist on your system before starting the container.
Contributions are welcome! If you have ideas or improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.
Created by ManghiDev. For more information, visit https://manghi.dev.