Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-telemetry]: Enable docker cmd inside sonic-telemetry #1976

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rules/docker-telemetry.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry
$(DOCKER_TELEMETRY)_RUN_OPT += --net=host --privileged -t
$(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

$(DOCKER_TELEMETRY)_RUN_OPT += -v /var/log/wtmp:/var/log/wtmp:ro

# enable docker cmd inside the telemetry container
$(DOCKER_TELEMETRY)_RUN_OPT += -v /var/run/docker.sock:/var/run/docker.sock:rw
$(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/bin/docker:/usr/bin/docker
$(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/lib/x86_64-linux-gnu/libapparmor.so.1:/usr/lib/x86_64-linux-gnu/libapparmor.so.1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this? can we install them in the docker instead of mapping them from the base image? also, what is docker cmd?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to use docker command like "docker ps" to get docker container list, or "docker exec -i vtysh -c 'show ip bgp summary'" to get bgp neighbor status.

If we want to get the docker information or access the other docker container in the host, we should mapping them from host.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

letting an application in one docker to directly access cmd in another docker poses security concern. It is better to community this thought the database, in this case, we can ask bgp docker to put information into database and then telemetry can read from database.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you really need vtysh in a non-quaggy container, please let me know. We have some solution with socket.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libapparmor [](start = 60, length = 11)

The libapparmor.so and libltdl.so files are docker dependency, so it is implementation details. We'd better not to handle it for better future.

$(DOCKER_TELEMETRY)_RUN_OPT += -v /usr/lib/x86_64-linux-gnu/libltdl.so.7:/usr/lib/x86_64-linux-gnu/libltdl.so.7