Skip to content

Commit c92e2df

Browse files
authored
Merge pull request #5 from manghidev/develop
Implementing versioning file for the project
2 parents efe34e0 + 436b249 commit c92e2df

File tree

8 files changed

+69
-25
lines changed

8 files changed

+69
-25
lines changed

.dotfiles/.config/nvim/lazy-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
2323
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
2424
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
25-
"nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
25+
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
2626
"nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" },
27-
"nvim-lspconfig": { "branch": "master", "commit": "46434074f188e6bfccf9d9153dd8be6b1381498b" },
27+
"nvim-lspconfig": { "branch": "master", "commit": "1b801f68d09e70e59e6dd967b663b6d84ee3e87d" },
2828
"nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" },
2929
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" },
3030
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#* Set the base image to Node.js LTS on Alpine
22
FROM node:lts-alpine
33

4+
ARG VERSION
5+
46
#* Set metadata for image
57
LABEL maintainer="ManghiDev <https://manghi.dev>" \
68
description="Dockerfile for LazyVim and Zsh with oh-my-zsh" \
7-
version="1.0.0"
9+
version=$VERSION
810

911
#* Install necessary dependencies
1012
RUN apk add --no-cache git lazygit fzf curl neovim ripgrep alpine-sdk zsh shadow

README.md

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,38 @@ This project provides a Dockerized environment to use LazyVim, an advanced Neovi
88

99
- **LazyVim**: Predefined Neovim configuration to maximize productivity.
1010
- **Dockerized**: Fully isolated and reproducible environment.
11-
- **Zsh with Oh My Zsh**: Interactive shell with plugins and advanced customization.
11+
- **bash with Oh My bash**: Interactive shell with plugins and advanced customization.
1212
- **Included tools**: `git`, `lazygit`, `fzf`, `ripgrep`, among others.
1313
- **Volume mounting**: Direct access to your local files from the container.
1414
- **Persistent configuration**: Configuration changes are retained between sessions.
1515

1616
---
1717

18+
## Versioning
19+
20+
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.
21+
22+
### How to Update the Version
23+
24+
1. Open the `VERSION` file in the root of the project.
25+
2. Update the version number (e.g., change `1.1.0` to `1.2.0`).
26+
3. Rebuild the Docker image using the `build.sh` script:
27+
```bash
28+
./build.sh
29+
```
30+
31+
### Checking the Version in the Docker Image
32+
33+
After building the image, you can verify the version embedded in the image by running:
34+
35+
```bash
36+
docker inspect <image_name> | grep '"version"'
37+
```
38+
39+
Replace `<image_name>` with the name of your Docker image.
40+
41+
---
42+
1843
## Requirements
1944

2045
- **Docker**: Make sure Docker is installed on your system.
@@ -46,26 +71,34 @@ chmod +x ./build.sh
4671

4772
## Installation
4873

74+
### Automatic Installation
75+
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:
76+
77+
```bash
78+
git clone https://github.com/manghidev/lazyvim-docker.git && cd lazyvim-docker && chmod +x ./build.sh ./init.sh ./destroy.sh && ./build.sh
79+
```
80+
81+
### Manual Installation
4982
1. Clone this repository:
50-
```bash
51-
git clone https://github.com/manghidev/lazyvim-docker.git
52-
cd lazyvim-docker
53-
```
83+
```bash
84+
git clone https://github.com/manghidev/lazyvim-docker.git
85+
cd lazyvim-docker
86+
```
5487

55-
2. Build the environment using the `build.sh` script:
56-
```bash
57-
./build.sh
58-
```
88+
2. 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):
89+
```bash
90+
./build.sh
91+
```
5992

60-
3. If you need to re-enter the container, use the `init.sh` script:
61-
```bash
62-
./init.sh
63-
```
93+
3. If you need to re-enter or run the container again, use the `init.sh` script:
94+
```bash
95+
./init.sh
96+
```
6497

65-
4. To destroy the environment (without deleting the volumes), use the `destroy.sh` script:
66-
```bash
67-
./destroy.sh
68-
```
98+
4. To destroy the environment (along with the volumes), use the `destroy.sh` script:
99+
```bash
100+
./destroy.sh
101+
```
69102

70103
---
71104

@@ -131,4 +164,4 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
131164

132165
## Author
133166

134-
Created by ManghiDev. For more information, visit [manghi.dev](https://manghi.dev).
167+
Created by ManghiDev. For more information, visit [https://manghi.dev](https://manghi.dev).

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.0

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
VERSION=$(cat VERSION)
2+
13
echo "Cleaning up the environment"
24
docker compose down --rmi all
35

46
echo "Pulling the latest images"
57
docker compose pull
68

7-
echo "Rebuilding the container"
8-
docker compose build --no-cache
9+
echo "Building the container with this version $VERSION"
10+
docker compose build --build-arg VERSION=$VERSION --no-cache
911

1012
echo "Starting the container"
1113
docker compose up --force-recreate -d

destroy.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Stop and remove the container
2-
docker compose down --rmi all
2+
# Stop and remove the container along with volumes
3+
docker compose down --rmi all --volumes
34

4-
echo "Container stopped and removed"
5+
echo "Container and volumes stopped and removed"

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
build:
44
context: .
55
dockerfile: Dockerfile
6+
args:
7+
VERSION: ${VERSION:-1.0.0}
68
container_name: lazyvim
79
volumes:
810
- .dotfiles/.zshrc:/home/developer/.zshrc

init.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
echo "Starting the container"
2+
docker compose up -d
3+
14
echo "Enter to the lazyvim container"
25
docker exec -it lazyvim zsh

0 commit comments

Comments
 (0)