HawkBit - Custom theme in docker image - eclipse-hawkbit

I would like to create a new color scheme on the server's management UI page. According to the instructions from the help page:
I created my own theme containing color changes
I changed the configuration to make my theme work (hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/themes/HawkbitTheme.java)
Build repo and run the server
I have noticed the color changes that I made. The target configuration is to run in docker containers. In this case, I rebuilt the server locally and ran it without using a container.
I wonder if in that case I will have to rebuild the entire repository, create a docker image, and mount such a custom container on my server?
Is it possible to add a theme to the docker image downloaded by default by dockercompose, and enable this theme by adding some entry to the application.properties file? If possible, then:
What would that entry be?
Where to copy theme files to container filesystem from hawkBit?
Tried: Look for some hints in documentation. Expectations: Find out if it is possible to add a theme to the finished docker image. If it is possible, how to do it?

Related

How to access files and folders from pulled docker image

this might be a trivial question but i researched a lot about it and couldn't find a clear answer.
I pulled a docker image from the docker hub and want to deploy on Azure Container Registry and connect it to an App Service. However, before I do so, I need to change the configuration in the files of the image. e.g, add elements to themes.xml.
Is there a way I can access these image folders and files to do so?
Thank you!
You can use the Docker save Command:
https://docs.docker.com/engine/reference/commandline/save/
After you've made your changes, you can save the files back to an Image with the Docker load Command:
https://docs.docker.com/engine/reference/commandline/load/
Hope that helps!

How can I update data in volume after web project was updated?

I have a Flask application + Gunicorn which I run inside docker container. I also have Nginx in another container and would like to serve static files (e.g. js files in static folder of Flask app), in order to do it I have to create volume and attach it to the static volume.
When I create volume and then run dockerized app (Flask + Gunicorn) there are no problems, js files are up-to-date.
Then I update app from Github (do git pull projectname, then do docker build -t myapp . and then I get a problem that files in volume are still the same. Note: this is not client side browser issue, js files are not changed in the volume.
The problem is not related to Ngnix, since it take place when Ngnix do not serve static files (I did not make the option in config yet, now it serve only ordinary requests).
I found the following way to solve the issue:
Stop container which use the volume (only Flask + Gunicorn app now, Nginx do not use the volume yet): docker rm -f appname_container
Remove the volume: ```docker volume rm flask_static_files_volume_name``
Recreate the volume: docker volume create flask_static_files_volume_name
Then run the Flask app again: docker run ... appname_container
As a result of the 4 steps the volume is populated with updated versions of all files. I see correct js file versions.
I have to do the steps each time I update the project. As fare as I understand it is correct volume behavior to maintain files after container restart, but is there any better way to solve the issue?
If your files are in git and not that huge in size, I would not bother with volumes. Volumes are meant for data that move often like a database or maybe file uploaded by a customer.
For files under git with a clear versioning scheme, for me they are part of your code and thus don't need a volume. Just include them in the container without a volume and recreate the full container on new release.
This is how docker/kubernetes would expect it to be done. This way you can easily do canary testing, blue green or progressive rollout or even a rollback to a previous version. The files are really part of the versioning scheme of the application and that's better.
You can even with the concept of "gitopts" (https://www.weave.works/technologies/gitops/) to automatically update your containers on git change in the main repo.
Of course, if on the contrary a given version of the app can serve arbitrar files without any notion of code release, then you may want volumes likely with some sort of database.

Create docker image from linux server on azure

I'm new to Docker, but I want to make an "image" for docker of my current server I have running on Azure. Now, I have readed the documentation, but that always tells me that I can make a new image... I want to image my current server to a docker file.
How can I do this? Like let's say, I have a linux server running on Azure with all my configuration settings applied on it. How can I do this? I really need this fast... I can test the created docker image on a computer of someone else, so how can I do this? Or what solution would that be?
You cannot convert your existing Linux box to a docker image. This is not how docker Works.
You can take a snapshot of your VM and créate another identical vm, not container.
For now, there is no way to make a docker image from an existing server.
If you want to build your self docker image, you should build docker image with docker file.
Or download an existing docker image, then do some change to it and save it as new image.
Hope this helps.

Customizing Guacamole login screen when using Docker

NOTE: I'm not a Linux expert so you might need to explain how to do things to help me resolve this issue.
I have a fresh install of Ubuntu 16.04
I installed Docker using this guide:
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
Next I installed Guacamole as a Docker container using this guide:
https://www.cb-net.co.uk/linux/running-guacamole-from-a-docker-container-on-ubuntu-16-04-lts-16-10/
Guacamole works fine and all is well, however I'm trying to make some customizations to the login screen and I can't seem to figure out how.
I understand that I need to put a jar file containing my guac-manifest.json customizations (which I already have) in the GUACAMOLE_HOME/extensions folder, which in normal circumstances would be located in /usr/share/tomcat8. However this folder (or any tomcat folders) don't exist on my system.
As far as I can gather, the tomcat conf folder is located INSIDE of the docker container. I'm not entirely sure how to make the changes I need inside of the container, but I would like my customizations to persist if the container is updated/destroyed. Any help on how I can achieve this goal would be greatly appreciated.

Continous development with Docker containers

I'm using docker for a new project for learning purposes. I thought that it would make things a lot easier since I have to setup the environment only once.
I've created a setup like this; I created a base image that installs Ubuntu and NodeJS. I've also created a Development image that copies a src (web application) folder into the container, then does an npm install and runs the server.js. That's basically it in a nutshell.
But now, whenever I make a change to my source code I have to stop the running container, and build the image and run it again. It doesn't take long to rebuild and run de Development image, but it gets a bit annoying to do that eveythime I make a change to my code during development.
What I normally had was a Gulp task or Browsersync watching my local files. Everytime I made a change, those changes were automatically visible in the browser. That really speeds up the development process.
I could still work like this during development by installing everything locally. But that kinda defeats the purpose of having a "development image". That means that I still have to configure all the systems that want to work on this web application with the appropiate Node version, Database schemes, port mappings, SSL settings, Certificats etc.
So my questions is, is there a way to run a container, and whenever I change the source code (locally), that it is then automatically pushed to the running container? So I have "continuous development"?
If I understood you correctly, you don't wish to build the Development image each time you update the src. If that's the situation, what you can do is:
For the Development Phase (When the Source code is update frequently):
Create a Dockerfile in such a way that make use of a shared volume (where the source code will reside).
In the shared volume, you can update the source code using the src container.
Also, if you need to do some additional task, you can write it in a script and call that script each time you update the source.
Later on, when the development phase ends, you may use your current Dockerfile to build the development image.

Resources