Hi, I’m trying to redirect docker binary and docker.sock into my jenkins docker container so it can use docker in its pipeline operations. I’m getting the following error when I do this:
bash: /usr/bin/docker: cannot execute: required file not found
here are the steps I followed;
- I get the absolute path of my host docker binary by doing
readlink -f $(which docker)
- I created a docker-compose file. here are the contents;
version: "3"
services:
jenkins:
image: jenkins/jenkins:lts
privileged: true
user: root
ports:
- 8080:8080
- 50000:50000
container_name: jenkins
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /nix/store/pah5a5r2kyzdzac2115xsgzgnpypf6ps-docker-24.0.5/bin/docker:/usr/bin/docker
- I run the jenkins container and got into jenkins container shell. run
docker
and got the following error:bash: /usr/bin/docker: cannot execute: required file not found
does anyone know how to fix this?
I can provide more information if necessary