Error exec into drone container

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

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/

Thanks bradrydzewski.

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

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-authentication/

You can also manage secrets in the user interface.

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 ?

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

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

Drone is awesome and i am loving it :slight_smile: