Docker Installation, How can i access to bench commands?

Hi.

I installed ERPNext on Docker using below guide,
https://github.com/frappe/frappe_docker/blob/develop/docs/single-bench.md

It installed successfully and working on browser as well.
The problem is in the backend using filezilla i can’t find the bench folder. also thats why i am unable to use the bench commands.

Can any body guide me how to use and access frappe bench in docker installation?

Bench is not installed in docker production images. Why cannot use bench inside docker console? · Issue #315 · frappe/frappe_docker · GitHub

for custom apps https://github.com/frappe/frappe_docker/blob/develop/docs/custom-apps-for-production.md

For executing internal frappe commands: frappe_docker/site-operations.md at main · frappe/frappe_docker · GitHub

2 Likes

Hi Revant,
I’m trying to clear cache for a production ERPNext site and I understand that Bench is not available in production images, so I tried to use the bench helper to run the command but I got the error “docker: invalid reference format.”.

Here is the command I tried:
docker run -v rockerp_sites-vol:/home/frappe/frappe-bench/sites --network rockerp_default --user frappe frappe/frappe-worker:$FRAPPE_VERSION bench --site rockerp.co.nz clear-cache

Host environment: Ubuntu 20.04.2 LTS.

Any help would be appreciated.

docker run -v rockerp_sites-vol:/home/frappe/frappe-bench/sites --network rockerp_default --user frappe frappe/erpnext-worker:v13.19.0 bench --site rockerp.co.nz clear-cache

make sure you’ve used the frappe/erpnext-worker image and specifed appropriate image tag.

Note: don’t use latest, develop or edge images in production.

1 Like

Just had a similar issue and was able to access the docker-frappe container to call bench commands using docker-compose:

docker-compose --project-name crm exec erpnext-python "bash"
# now you are in the python container
cd {YOUR_SITENAME}
# Then you can call bench commands

you can execute the bench commands from the ~/frappe-bench/sites directory. No need to change to {YOUR_SITE} unless you need to edit any config files or do any other changes.