Docker improvements (#2088)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-20 16:22:48 +02:00
committed by GitHub
parent 9bce89fcb8
commit 4a8be5ee75
11 changed files with 158 additions and 242 deletions

View File

@@ -4,49 +4,42 @@ hawkBit Docker
# Setup
## A: Docker Container
Start the hawkBit Update Server as a single container
Start the hawkBit Update Server as a single container (requires Docker to be installed and all dependencies to be available)
```bash
$ docker run -d -p 8080:8080 hawkbit/hawkbit-update-server:latest
```
## B: Docker Compose
Start the hawkBit Update Server together with an MySQL and RabbitMQ instance as containers
Start the hawkBit Update Server together with an MySQL and RabbitMQ instance as containers (Requires Docker Compose to be installed)
```bash
# Requires Docker Compose to be installed
$ docker-compose up -d
$ docker compose -f docker-compose-monolith-mysql.yml up
```
You could, also start it in different flavours, with UI or in microservices mode.
## C: Docker Stack
Start the hawkBit Update Server and Device Simulator together with an MySQL and RabbitMQ instance as services within a
swarm
Note: Whit the upper command CTRL+C shuts down all services. Add '-d' at the end to start all into detached mode:
```bash
$ docker swarm init
$ docker stack deploy -c docker-compose-deps-mysql.yml hawkbit
$ docker compose -f docker-compose-monolith-mysql.yml up -d
```
Then stop all services with:
```bash
$ docker compose -f docker-compose-monolith-mysql.yml down
```
# Access
| Service / Container | URL | Login | A | B | C |
|--------------------------|--------------------------------------------------|-------------|----------|----------|----------|
| hawkBit Update Server | [http://localhost:8080/](http://localhost:8080/) | admin:admin | &#10003; | &#10003; | &#10003; |
| hawkBit Device Simulator | [http://localhost:8083/](http://localhost:8083/) | - | | | &#10003; |
| MySQL | localhost:3306/hawkbit | root | | &#10003; | &#10003; |
| RabbitMQ | [http://localhost:15672](http://localhost:15672) | guest:guest | | &#10003; | &#10003; |
# Configuration
You can override application.properties by setting an environment variable SPRING_APPLICATION_JSON for hawkbit
container.
You can override application.properties by setting an environment variable SPRING_APPLICATION_JSON for hawkbit container.
```
hawkbit:
image: "hawkbit/hawkbit-update-server:latest-mysql"
image: "hawkbit/hawkbit-update-server:latest"
environment:
SPRING_APPLICATION_JSON: '{
"spring.datasource.url": "jdbc:mariadb://mysql:3306/hawkbit",