Skip to content

Commit 3a99b46

Browse files
author
Alex Fabijanic
committed
export docker socket file name
1 parent 198c626 commit 3a99b46

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

userspace/libsinsp/docker.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "sinsp_int.h"
1010
#include "user_event.h"
1111

12+
const std::string docker::DOCKER_SOCKET_FILE = "/var/run/docker.sock";
13+
1214
docker::docker(const std::string& url,
1315
const std::string& path,
1416
const std::string& http_version,
@@ -17,7 +19,7 @@ docker::docker(const std::string& url,
1719
bool verbose,
1820
event_filter_ptr_t event_filter): m_id("docker"),
1921
#ifdef HAS_CAPTURE
20-
m_url(!url.empty() ? url : std::string(scap_get_host_root()) + "/var/run/docker.sock"),
22+
m_url(!url.empty() ? url : std::string(scap_get_host_root()) + DOCKER_SOCKET_FILE),
2123
m_collector(false),
2224
#endif // HAS_CAPTURE
2325
m_timeout_ms(timeout_ms),

userspace/libsinsp/docker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
class docker
1818
{
1919
public:
20+
static const std::string DOCKER_SOCKET_FILE;
21+
2022
typedef std::vector<std::string> uri_list_t;
2123
typedef std::shared_ptr<Json::Value> json_ptr_t;
2224
typedef std::set<std::string, ci_compare> event_filter_t;

0 commit comments

Comments
 (0)