Running configuration generator as a Docker container #1451
-
I'm trying to run the configurator generator as a Docker container, and I'm able to build it. Unfortunately, I do not understand the proper syntax to pass the "generator.yml" and mibs folder to the container. The readme for the generator states: "If you would like to run the generator in docker to generate your snmp.yml config run the following commands. The Docker image expects a directory containing the generator.yml and a directory called mibs that contains all MIBs you wish to use." How does it expect the directories? I can map a volume, but how do I make sure that the generator command receives it properly? What are the proper arguments for this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
From the Makefile:
you can either change the volume mount to another dir, or use the cmdline flags |
Beta Was this translation helpful? Give feedback.
-
If anyone is looking for this. You have to make sure to bind mount the location where you have your "mibs" folder and your "generator.yml" folder to the /opt folder inside the container. The "snmp.yml" output will end up in the folder you bound. This is an example of my Dockerfile:
|
Beta Was this translation helpful? Give feedback.
From the Makefile:
docker run --rm -v "${PWD}:/opt$(DOCKER_VOL_OPTS)" "$(DOCKER_REPO)/$(DOCKER_IMAGE_NAME):$(SANITIZED_DOCKER_IMAGE_TAG)" --no-fail-on-parse-errors generate
you can either change the volume mount to another dir, or use the cmdline flags
-m (mibdir)
and-g (generator-path to yml)