I need run command to docker container in a script, i trying with:
docker run -it <container> /bin/bash -c "command"
I had no error but the command is not executed
I can not create a new image, i must not stop the service ... I do it manually
It's possible to invoke a command in a running container:
docker exec <container_id> rm -f /tmp/cache/*/*/*
rm -f /tmp/cache/*/*/* is what you actually need? Are you going to remove /tmp/cache and all its subfolders? If so, then rm -rf /tmp/cache is what you needrm -rf it erase all folder and nginx stop working, i need stop and start container, instead rm -f erase only file in all folder and suibfolder.find /tmp/cache/ -type f -delete. You may also add -maxdepth <n> if you want.
docker run -it <container> /bin/bash -c "echo 'Hello'"works fine. <container> is centos in my casedocker commit nginxsuccessful, but the files are still there