67 lines
1.4 KiB
Markdown
67 lines
1.4 KiB
Markdown
|
# PTUT Virtual Environment
|
||
|
|
||
|
|
||
|
## Requirements
|
||
|
|
||
|
You need a consistent Linux System with the following packages :
|
||
|
- `docker`
|
||
|
- `make`
|
||
|
- `cpp` (C pre-processor)
|
||
|
|
||
|
|
||
|
## Commands
|
||
|
|
||
|
In order for the environment to be launched, we need to run configuration commands, installation instructions, etc and store the final state in a **docker image**. Then we can launch several **containers** from that initial image.
|
||
|
|
||
|
The building process is automated with the *Makefile* and the `make` command.
|
||
|
|
||
|
---
|
||
|
### 1. Build the Dockerfile
|
||
|
|
||
|
```bash
|
||
|
make build
|
||
|
```
|
||
|
|
||
|
- Creates the *Dockerfile* using the *c pre-processor* to include the files in `docker/include` in `docker/main`. The final output is located at the root of the repository in `./Dockerfile`.
|
||
|
|
||
|
---
|
||
|
### 2. Create the docker image
|
||
|
|
||
|
```bash
|
||
|
make image
|
||
|
```
|
||
|
|
||
|
- Creates the **docker image** from the Dockerfile. If `./Dockerfile` is missing, it will automatically launch `make build`.
|
||
|
|
||
|
---
|
||
|
### 3. Launch the container
|
||
|
|
||
|
```bash
|
||
|
make run
|
||
|
```
|
||
|
|
||
|
- Builds the image (*make image*)
|
||
|
- Launches the container (*make run*)
|
||
|
|
||
|
---
|
||
|
### 4. Properly kill a container
|
||
|
|
||
|
```bash
|
||
|
make kill
|
||
|
```
|
||
|
|
||
|
- Properly kills a running container
|
||
|
|
||
|
|
||
|
---
|
||
|
### 5. Launch the CI loop
|
||
|
|
||
|
```bash
|
||
|
make boot
|
||
|
```
|
||
|
|
||
|
- Launches an infinite loop that
|
||
|
1. Updates the git repository (*git pull*)
|
||
|
2. Builds the image (*make image*)
|
||
|
3. Launches the container (*make run*)
|
||
|
4. When the container stops, delete it and reloop
|