Skip to content

Commit 20cc1e4

Browse files
[Docs] Update prerequisites docs (#3392)
* add prerequisites for ubuntu * Update prerequisites.md --------- Co-authored-by: Roman Zabaluev <[email protected]>
1 parent 9f1a4df commit 20cc1e4

File tree

1 file changed

+103
-10
lines changed

1 file changed

+103
-10
lines changed

documentation/project/contributing/prerequisites.md

Lines changed: 103 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,71 @@
1-
### Prerequisites
1+
## Prerequisites
22

3-
This page explains how to get the software you need to use a Linux or macOS
4-
machine for local development.
3+
This page explains how to get the software you need to use on Linux or macOS for local development.
54

6-
Before you begin contributing you must have:
5+
* `java 17` package or newer
6+
* `git` installed
7+
* `docker` installed
78

8-
* A GitHub account
9-
* `Java` 17 or newer
10-
* `Git`
11-
* `Docker`
9+
> Note: For contribution, you must have `github` account.
1210
13-
### Installing prerequisites on macOS
11+
### For Linux
12+
13+
1. Install `OpenJDK 17` package or newer:
14+
15+
```
16+
sudo apt update
17+
sudo apt install openjdk-17-jdk
18+
```
19+
20+
* Check java version using command `java -version`.
21+
22+
```
23+
openjdk version "17.0.5" 2022-10-18
24+
OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu120.04)
25+
OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu120.04, mixed mode, sharing)
26+
```
27+
28+
Note : In case OpenJDK 17 is not set as your default Java, run `sudo update-alternatives --config java` command to list all installed Java versions.
29+
30+
```
31+
Selection Path Priority Status
32+
------------------------------------------------------------
33+
* 0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
34+
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
35+
2 /usr/lib/jvm/java-16-openjdk-amd64/bin/java 1051 manual mode
36+
3 /usr/lib/jvm/java-17-openjdk-amd64/bin/java 1001 manual mode
37+
38+
Press <enter> to keep the current choice[*], or type selection number:
39+
```
40+
41+
you can set it as the default by entering the selection number for it in the list and pressing Enter. For example, to set Java 17 as the default, you would enter "3" and press **Enter**.
42+
43+
2. Install `git`:
44+
45+
```
46+
sudo apt install git
47+
```
48+
49+
3. Install `docker`:
50+
51+
```
52+
sudo apt update
53+
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
54+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
55+
sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
56+
apt-cache policy docker-ce
57+
sudo apt -y install docker-ce
58+
```
59+
60+
To execute the `docker` Command without `sudo`:
61+
62+
```
63+
sudo usermod -aG docker ${USER}
64+
su - ${USER}
65+
sudo chmod 666 /var/run/docker.sock
66+
```
67+
68+
### For macOS
1469

1570
1. Install [brew](https://brew.sh/).
1671
2. Install brew cask:
@@ -37,6 +92,44 @@ export JAVA_HOME="$(/usr/libexec/java_home -v 17)"
3792
Consider allocating not less than 4GB of memory for your docker.
3893
Otherwise, some apps within a stack (e.g. `kafka-ui.yaml`) might crash.
3994

95+
To check how much memory is allocated to docker, use `docker info`.
96+
97+
You will find the total memory and used memory in the output. if you won't find used memory thats mean memory limits are not set for containers.
98+
99+
#### To allocate 4GB of memory for Docker:
100+
101+
#### For Ubuntu
102+
103+
1. Open the Docker configuration file in a text editor using the following command:
104+
105+
```
106+
sudo nano /etc/default/docker
107+
```
108+
109+
2. Add the following line to the file to allocate 4GB of memory to Docker:
110+
111+
```
112+
DOCKER_OPTS="--default-ulimit memlock=-1:-1 --memory=4g --memory-swap=-1"
113+
```
114+
115+
3. Save the file and exit the text editor.
116+
117+
4. Restart the Docker service using the following command:
118+
119+
```
120+
sudo service docker restart
121+
```
122+
123+
5. Verify that the memory limit has been set correctly by running the following command:
124+
125+
```
126+
docker info | grep -i memory
127+
```
128+
129+
Note that the warning messages are expected as they relate to the kernel not supporting cgroup memory limits.
130+
131+
Now any containers you run in docker will be limited to this amount of memory. You can also increase the memory limit as your preference.
132+
40133
## Where to go next
41134

42-
In the next section, you'll [learn how to Build and Run kafka-ui](building.md).
135+
In the next section, you'll learn [how to Build and Run kafka-ui](building.md).

0 commit comments

Comments
 (0)