You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hello,
What I am trying to do.
I want to create a regression test for the service of Telegraf. This can essentially be done by running `telegraf --test`. As we are running this with a docker-compose definition we would like to use this same docker-compose to run the test.
As Telegraf is also collecting docker metrics, we also need to mount the `docker.sock`.
version: '3.7'
services:
telegraf:
image: telegraf:1.18.3-alpine
restart: unless-stopped
environment:
- TELEGRAF_HOSTNAME=${TELEGRAF_HOSTNAME:?}
volumes:
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock
The issue
It seems that Telegraf cannot authenticate against the docker.sock API:
2021-08-11T07:40:12Z E! [inputs.docker] Error in plugin: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.21/info": dial unix /var/run/docker.sock: connect: permission denied
2021-08-11T07:40:12Z E! [inputs.docker] Error in plugin: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.21/containers/json?filters=%7B%22status%22%3A%5B%22running%22%5D%7D&limit=0": dial unix /var/run/docker.sock: connect: permission denied
What I tried
I do not seem to be able to locate the `/var/run/docker.sock` inside of the pipeline using the following step definitions:
- step:
name: "Test Telegraf config"
services:
- docker
script:
- cd ${BITBUCKET_CLONE_DIR}/telegraf
- TELEGRAF_HOSTNAME=$(hostname) docker-compose run telegraf telegraf --test
How can I use the docker.sock that is required by the services I try to test?
+1 also facing this issue, which is kinda blocking me from running E2E tests properly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.