Bench Update not working in Docker

Hi Everyone

I’m trying to update my local Containerized ERPNext instance branches using “Bench update”, but command not executing and also not throwing any errors to identify.

Screenshot attached below for your reference.

Please do let me know any other command should I use instead “Bench Update” in Docker ERPNext instance.

Thanks in advance :slightly_smiling_face:

Bench update won’t work in production containers.
Containers are immutable, you’ve to replace them with new ones.

You’ve to change the VERSION environment variables and re-deploy the containers.
Then you’ll need to migrate sites frappe_docker/ at main · frappe/frappe_docker · GitHub

By screenshot you’re using development setup.

Pull the latest frappe/bench:latest docker image and then try rebuilding the devcontainers

1 Like

Hi @revant_one

Thank you for quick response,

Could you please tell me in which file I need to change the Version, because I’m new this docker setup.

And I would like to explain my requirement :
My requirement is we are already using ERPNext V12 and customApp with some transaction, we would like to upgrade our ERPNext version from V12 to V13.

Check this entry if it helps GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext

You will need to build your own docker images for your apps.

Hello @revant_one ! The link you’ve mentioned is broken:

I’ve updated my app with a new JS located in apps’ public folder, but even running bench migrate in the container after pulling a new image, the new JS file wasn’t created in sites/assets folder

What version file do you mean?
PS: frappe and erpnext versions still the same in the docker image, I’ve changed just my app

we removed wiki links

briefly it mentioned,

  1. setup fresh bench
  2. restore sites from production
  3. Run migration to find failing patches.

it’ll help you safely run migration on production by trying it out on fresh setup.

you’ll need to populate new assets in assets volume for shared use by worker containers.


  # populate-assets:
  #   image: frappe/erpnext-nginx:${VERSION}
  #   deploy:
  #     restart_policy:
  #       condition: none
  #   entrypoint: ["sh", "-c"]
  #   command:
  #     - >
  #       cp -fR /usr/share/nginx/html/assets /data;
  #       touch /data/sites/.build;
  #   volumes:
  #     - assets:/data/assets:rw
  #     - sites:/data/sites:rw

use restart instead of restart_policy if not using swarm

Thanks @revant_one for answer! I understand that files should be copied, but doesn’t it have any existing script in frappe or erpnext image that does this copy autommaticaly?

It also has to update assets.json with the new scripts, or not?

In order to explain better the situation, my app it’s called “soma”, so when I go in the backend container, I see the new JS files in /frappe-bench/apps/soma/soma/public folder, but they aren’t present in /home/frappe/frappe-bench/sites/assets , even the “soma” folder wasn’t created inside the assets folder.

In development environment, running bench build created “soma” folder inside assets with my new scripts, but in Docker there isn’t bench build.

I believe that some step of the image build or a script should do this copy, besides your suggestion to do it in docker-compose.

Could we have a script within the frappe docker image to rebuild custom app assets?

manual steps mentioned here frappe_docker/ at main · frappe/frappe_docker · GitHub

for helm we’re using initContainer to populate-assets

any better way you can suggest to make it into a script?