# Error exec into drone container

**URL:** <https://drone.discourse.group/t/error-exec-into-drone-container/7794>\
**Category:** Drone Support\
**Created:** [September 20, 2017, 1:27pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794 "2017-09-20T13:27:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishal24tuniki](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vishal24tuniki](https://drone.discourse.group/u/vishal24tuniki)\
**Post date:** [September 20, 2017, 1:27pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/1 "2017-09-20T13:27:30Z")

</div>

ubuntu@ip-172-31-2-152:~$ docker exec -it ubuntu\_drone-server\_1 /bin/bash  
rpc error: code = 2 desc = oci runtime error: exec failed: container\_linux.go:262: starting container process caused “exec: “/bin/bash”: stat /bin/bash: no such file or directory”

ubuntu@ip-172-31-2-152:~$ docker exec -it ubuntu\_drone-agent\_1 /bin/bash  
rpc error: code = 2 desc = oci runtime error: exec failed: container\_linux.go:262: starting container process caused “exec: “/bin/bash”: stat /bin/bash: no such file or directory”

ubuntu@ip-172-31-2-152:~$ docker exec -it ubuntu\_drone-agent\_1 drone  
rpc error: code = 2 desc = oci runtime error: exec failed: container\_linux.go:262: starting container process caused “exec: “drone”: executable file not found in $PATH”

Any exec commands into drone container are failing. How do i solve this?  
My docker-compose.yml

version: ‘2’

services:  
drone-server:  
image: drone/drone:0.7  
ports:  
- 8000:8000  
volumes:  
- /var/lib/drone:/var/lib/drone/  
restart: always  
environment:  
- DRONE\_OPEN=true  
- DRONE\_GITHUB\_URL=${DRONE\_GITHUB\_URL}  
- DRONE\_ORGS=${DRONE\_ORGS}  
- DRONE\_ADMIN=${DRONE\_ADMIN}  
- DRONE\_HOST=${DRONE\_HOST}  
- DRONE\_GITHUB=true  
- DRONE\_GITHUB\_CLIENT=${DRONE\_GITHUB\_CLIENT}  
- DRONE\_GITHUB\_SECRET=${DRONE\_GITHUB\_SECRET}  
- DRONE\_SECRET=${DRONE\_SECRET}

drone-agent:  
image: drone/drone:0.7  
command: agent  
restart: always  
depends\_on:  
- drone-server  
volumes:  
- /var/run/docker.sock:/var/run/docker.sock  
environment:  
- DRONE\_SERVER=ws://drone-server:8000/ws/broker  
- DRONE\_SECRET=${DRONE\_SECRET}

and docker containers  
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES  
777bca17521f drone/drone:0.7 “/drone agent” 3 days ago Up 3 days 80/tcp, 443/tcp, 8000/tcp ubuntu\_drone-agent\_1  
c0ca7c21b61b drone/drone:0.7 “/drone server” 3 days ago Up 3 days 80/tcp, 443/tcp, 0.0.0.0:8000-\>8000/tcp ubuntu\_drone-server\_1

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [September 20, 2017, 3:43pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/2 "2017-09-20T15:43:47Z")

</div>

This is the expected behavior because the drone container is built from `scratch` [1] and is therefore completely empty. It does not have bash installed, or any other utilities.

[1] [https://hub.docker.com/\_/scratch/](https://hub.docker.com/_/scratch/)

---

<div class="post-metadata">

**Author:** ![vishal24tuniki](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vishal24tuniki](https://drone.discourse.group/u/vishal24tuniki)\
**Post date:** [September 20, 2017, 5:24pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/3 "2017-09-20T17:24:32Z")

</div>

Thanks bradrydzewski.

If so how do i add drone secrets etc or for that matter run any drone commands?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [September 20, 2017, 5:32pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/4 "2017-09-20T17:32:52Z")

</div>

Sorry, I’m not sure I fully understand …

We have a command line utility that you can use to remotely connect with the server and manage secrets and execute various API commands:  
[http://docs.drone.io/cli-installation/](http://docs.drone.io/cli-installation/)  
[http://docs.drone.io/cli-authentication/](http://docs.drone.io/cli-authentication/)

You can also manage secrets in the user interface.

---

<div class="post-metadata">

**Author:** ![vishal24tuniki](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vishal24tuniki](https://drone.discourse.group/u/vishal24tuniki)\
**Post date:** [September 20, 2017, 5:43pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/5 "2017-09-20T17:43:20Z")

</div>

Awesome, i didn’t know that.  
Is there any specific port that needs to be open for me to connect to my cloud instance? or it uses port 22 ?

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [September 20, 2017, 5:45pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/6 "2017-09-20T17:45:40Z")

</div>

No additional configuration is required. The CLI uses the REST API which is also used by the web front-end.

---

<div class="post-metadata">

**Author:** ![vishal24tuniki](https://avatars.discourse-cdn.com/v4/letter/v/e480ec/32.png) [@vishal24tuniki](https://drone.discourse.group/u/vishal24tuniki)\
**Post date:** [September 20, 2017, 5:47pm UTC](https://drone.discourse.group/t/error-exec-into-drone-container/7794/7 "2017-09-20T17:47:10Z")

</div>

Cool, using the normal http/ https port itself. Thanks a lot.

Drone is awesome and i am loving it 🙂
