Create docker image from linux server on azure - linux

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.

Related

HawkBit - Custom theme in docker image

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?

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 do I locate docker image in a registry when only knowing image name and registry url by running podman and skopeo tool?

If I only know docker image name and registry url, and I am running podman and skopeo and etc. tools, how do I locate docker image in a registry?
I need to find out its full path in the registry and tag.
Thank you
can you explain more details.
From what I understand you maybe want to list the available images, e.g. using skopeo can be achieved as:
skopeo list-tags docker://docker.io/fedora
If this is not what you are looking for, then please share more information. What registries are involved, do you want to list the running images using podman cli and from that detect the full remote registry path and the tag used when pulling the image?

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.

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.

Resources