Update Invoiceninja in docker container

Hi all,

I want to update my Invoiceninja installation. I pull from github the latest changes, then I ran ninja:post-update but I received an error as follow:

silvia@zago:~/invoiceninja5/dockerfiles$ docker-compose exec app php artisan ninja:post-update

The “–no-dev:” option does not exist.

install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-suggest] [–no-dev] [–no-autoloader] [–no-scripts] [–no-progress] [–no-install] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [–ignore-platform-req IGNORE-PLATFORM-REQ] [–ignore-platform-reqs] [–] […]

How I can update to latest release?

Thank you
Silvia

docker-compose down
docker-compose pull
docker-compose up

Will not that action remove volumes too?

@nacesprin

nope, it only updates the container

Only to confirm:
Does It update the container and keep current volume with no data loss?

Yes, all volumes are kept with no data loss

Stops containers managed by the docker-compose.yml file and removes them. Removing containers does not remove persisted data which were mounted into the contianers via bind mounts or volumes.


Pulls all images defined in docker-compose.yml file if there are newer versions on the registry server. You can pull images with a specific tag if you want to.

Example:

version: "3"
services:
  invoiceninja:
    image: invoiceninja/invoiceninja:latest
(...)

This will always pull the latest (newest) docker image for invoiceninja.

version: "3"
services:
  invoiceninja:
    image: invoiceninja/invoiceninja:5.5
(...)

This will pull the latest docker image for invoiceninja v5.5.x, but not 5.6.x or newer.


Starts containers managed by the docker-compose.yml file. I’d recommend starting them with the option --detach or -d to start them in the background.


My prefered solution for updating IN is this little oneliner:

docker compose pull -q; [[ $(grep -q '<none>'< <(docker compose images)) ]] && docker compose up -d --force-recreate;

This command pulls new images and if they were updated, it recreates the containers. This reduces the “downtime” to the minimum and recreates the containers only if necessary.


Best regards
@Access-InTech

1 Like

Btw:
@hillel

accessintech@svrs:~$ docker-compose --version
docker-compose version 1.29.2, build 5becea4c

accessintech@svrs:~$ docker compose version
Docker Compose version v2.18.1
accessintech@svrs:~$ 

You should consider updating the update hint to Docker Compose V2 (docker compose instead of docker-compose)

1 Like

Thanks for the suggestion!

cc @david

1 Like

Hi, guys,

sometimes, even when IN tells me to update, docker-compose won’t find any new files to pull. Right now I’m waiting to pull version 5.8.12 from 5.8.10.

Me too. Waiting for it.

Regards.

Alright! I could pull an update right now.