BusyBox
uses sh -c
differently, and tini
is trying to execute the whole command as a binary rather than passing it to the shell.
Modify command like this:
command: ["/bin/sh", "-c", "mkdir -p /usr/local/unbound/cachedb.d && chown -R 1000:1000 /usr/local/unbound/cachedb.d/"]
This ensures the directory exists before attempting to change ownership.
docker-compose.yml
file after update
services:
unbound-db-socket:
image: busybox:latest
container_name: unbound-db-socket
init: true
tty: true
command: ["/bin/sh", "-c", "mkdir -p /usr/local/unbound/cachedb.d && chown -R 1000:1000 /usr/local/unbound/cachedb.d/"]
volumes:
- "cachedb.d:/usr/local/unbound/cachedb.d/"
volumes:
cachedb.d:
networks:
bridge: