malaskowski / aet-docker

Docker support for AET - easy to set up local/developer environment with example Docker Swarm configuration.
Apache License 2.0
8 stars 9 forks source link

OSGi configs configured via mounted volume #6

Closed malaskowski closed 5 years ago

malaskowski commented 5 years ago

OSGi configs configured via mounted volume

malaskowski commented 5 years ago

@wiiitek Thanks for your comment. Originally I wanted to avoid using volumes to configure OSGi because mounting volume to the relative swarm file is quite tricky when using docker tools. So that I wanted users can start no matter using Docker for Windows/Linux/Mac or Docker tools without deep knowledge. Further I went into configuring and specifying configs, I realized that using docker config is also complicated (especially when it comes to updating configs). And I now see that it is not the best approach. I will change the approach to the one you proposed with mounted volume. Thanks @wiiitek again for the inspiration :)

malaskowski commented 5 years ago

Btw, just a cosmetics, but you can't use docker compose for the swarm - they are not compatible with some features.

malaskowski commented 5 years ago

@wiiitek Let me know what do you think about configs now. Unfortunatelly, when working with Docker Tools, Karaf does not detect config changes made directly on the host (when I do the changes from the VM, Karaf notices it, so probably this will be not an issue when using Docker for Win/Mac/Linux).

wiiitek commented 5 years ago

Thanks @Skejven! I will test it in Docker on Linux sometime soon. :)

wiiitek commented 5 years ago

Hi @Skejven, thankk you for clarification. now I know that docker-compose is something different that swarm :)

I have tested this feature branch on Linux (Fedora 28 with Docker 18.09.0) and was able to observe, that OSGi configuration updates instantly when config file is updated.

However I needed to read a little about overlay network used with swarm. To find IP address of aet_karaf service I needed:

  1. check karaf container name: docker container ls (for me it was 56afc86873c8)
  2. check exposed IP addres by inspecting docker_gwbridge network: docker inspect docker_gwbridge:
[
    {
        //...
        "Containers: [
            "56afc86873c873503a758d6f1dac38cd7b124479f32e8635ebfa2df0c6813813": {
                //...
                "IPv4Address": "172.18.0.12/16"
            }
        ]
    }
]

Then i was able to check bundles at http://172.18.0.11:8181/system/console/bundles.

How is it for Docker Tools on Windows? Maybe the issues with configs not being updated are related to folder sharing with VirtualBox?

malaskowski commented 5 years ago

That's odd. With Docker Tools on Windows, when you create a swarm, you can see all the services within the swarm and have access to all ports that those services expose via the IP of the docker machine. Similar thing goes on the Docker for Mac and Docker for Ubuntu I've checked. You have direct access to http://localhost:8181/system/console.

Maybe the issues with configs not being updated are related to folder sharing with VirtualBox?

For sure it is related with it :)