Giter Site home page Giter Site logo

gitci-hawkbit-container's Introduction

Run Hawkbit in a Docker Container

Build the Image

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 .

Run the Container

The container now needs three more containers to run:

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 is hawkbit. 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

gitci-hawkbit-container's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.