Igor
Igor

Reputation: 225

Cannot map agent.conf using Cygnus docker installation

I have problem installing CYGNUS using docker as source, simply i cannot understand where i should map what specific agent.conf.

Image i am using is from here.

When i try to map agent.conf witch have my specific setup to container it starts and run but fail to copy, and not only that any change i made to file inside container wont stay it returns to previous default state.

While i have no issues with grouping_rules.conf using same approach.

I used docker and docker compose both same results. Path on witch i try to copy opt/apache-flume/conf/agent.conf

docker run -v /home/igor/Documents/cygnus/agent.conf:/opt/apache-flume/conf/agent.conf fiware/cygnus-ngsi

Can some who managed to run it using his config tell me if i misunderstood location of agent.conf or something because this is weird, i used many docker images and never had issue where i was not able to copy from my machine to docker container.

Thanks in advance.

** EDIT **

Link of agent.conf

Upvotes: 0

Views: 110

Answers (1)

Emiliano Viotti
Emiliano Viotti

Reputation: 1709

Did you copy the agent.conf file to your directory before start the container?

As you can see here, when you define a volume with "-v" option, docker copies the content of the host directory, inside the container directory using the mount point. Therefore, you must first provide the agent.conf file on your host.

The reason is that when using a "bind mounted" directory from the host, you're telling docker that you want to take a file or directory from your host and use it in your container. Docker should not modify those files/directories, unless you explicitly do so. For example, you don't want -v /home/user/:/var/lib/mysql to result in your home-directory being replaced with a MySQL database.

If you do not have access to the agent.conf file, you can download the template in the source code from the official cygnus github repo here. You can also copy it once the docker container is running, using the docker cp option:

docker cp <containerId>:/file/path/within/container /host/path/target

Keep in mind, that you will have to edit the agent.conf file to configure it according to the database you are using. You can find in the official doc how to configure cygnus to use differents sinks like MongoDB, MySQL, etc.

I hope I have been helpful.

Best regards!

Upvotes: 0

Related Questions