I apply this solution exclusively on the development environment. I have found that having the power to bail out to a shell whenever docker compose does not support something helps me iterate faster on my local dev (without affecting others).
The following is just a contrived example. Why would I do that? Because I can
# Bring up services without a command
#
# usage:
# nocmd.sh up -d service_name
function _compose {
docker-compose -f docker-compose.yml $@
}
function nocmd {
cat << EOF
services:
$1:
command: tail -f /dev/null
EOF
}
function nocmd_compose {
local service=${@: -1}
_compose -f <(nocmd "$service") $@
}
nocmd_compose $@
The following is just a contrived example. Why would I do that? Because I can