- For info about Hawkbit see: https://github.com/eclipse/hawkbit/
You might want to change some values from the default ones used in the configuration files.
Look at the application.properties file and change:
- Default RabbitMQ username and password (
spring.rabbitmq.username
,spring.rabbitmq.password
) (if different). - MariaDB URL, username and password (
spring.datasource.url
,spring.datasource.username
,spring.datasource.password
), and the name of the database used. - MongoDB URI (
spring.data.mongodb
). - The Hawkbit password and user (
hawkbit.server.ui.demo.password
,hawkbit.server.ui.demo.user
).
The image can take a while to build.
docker build -t hawkbit --force-rm .
The container now needs three more containers to run:
- A MariaDB one (called
srv-mariadb
) - A RabbitMQ one (called
srv-rabbitmq
) - A mongodb one (called
srv-mongodb
)
Since the --link
options is a deprecated legacy,
it is necessary to create a dedicated network where all the above containers,
plus the Hawkbit one, will run.
Create the hawkbit-net
network:
docker network create hawkbit-net
Start a MariaDB container as explained in the offial container image documentation.
You need to specify the MYSQL_USER
, MYSQL_PASSWORD
, MYSQL_DATABASE
values,
and those should be reflected in the application.properties
file.
docker run -dit --network=hawkbit-net --name srv-mariadb -e MYSQL_ROOT_PASSWORD=ROOT_PASSWORD -e MYSQL_USER=USER_NAME -e MYSQL_PASSWORD=USER_PASSWORD -e MYSQL_DATABASE=DB_NAME mariadb
Note that the default database name, the value for the
MYSQL_DATABASE
variable, as defined in the hawkbit container ishawkbit
. This cannot be changed without rebuilding the hawkbit container.
Run rabbitmq and mongdb:
docker run -dit --network=hawkbit-net --name srv-mongodb mongo:3.2
docker run -dit --network=hawkbit-net --name srv-rabbitmq --hostname srv-rabbitmq rabbitmq
When all the containers are up, start the Hawkbit one:
docker run -dit --network=hawkbit-net --name hawkbit -p 8080:8080 linaroproduct/ -v secrets.properties:/srv/secret/secrets.properties gitci-hawkbit-container
The secrets.properties
file available in the repository is just an example:
it should match at least the values defined for the Mariadb container before.
The file has to be mounted at /srv/secrets/secrets.properties
.
If you prefer to use the --link
mode to connect the various containers, remove
the --network
argument from the commands above, and on the last one (the one
that runs Hawkbit) include:
--link srv-mariadb:srv-mariadb --link srv-mongodb:srv-mongodb --link srv-rabbitmq:srv-rabbitmq
Once the container is up and running and the application started (in can take
~40 seconds for the application to start the first time), head to http://localhost:8080/UI
and login with the Hawkbit username and password configured (by default admin
/admin
).
From here on:
Hic sunt dracones