Open MANS0FT opened 1 year ago
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
The whole premise of Docker is that we try and have the containers be somewhat 'disposable' - You should be able to chuck aside the old container, then spin up with a new one, and then you'll just be migrated to that new one. Even migrations, which happen to the database, not to the Snipe-IT app itself, should be handled since the "Docker entrypoint" runs migrations before starting the webserver.
Especially if you're discarding the old container, I find it a bit baffling that for some reason you keep picking up the old version and not the new one? Maybe you need to try docker pull snipe/snipe-it
or something? If you type docker images
do you see a relatively new-ish (by date) image for snipe/snipe-it?
I agree 100% with what you wrote. In my case, only deleting the volume (website) allows you to get a new version of SNIPEIT - unfortunately, then I lose all attachments and image files.
Below is a snippet of my configuration.
itam.example.com_db:
container_name: itam.example.com_db
image: mariadb:latest
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
env_file: snipeit/itam.example.com.env
networks:
- 'sme-tier'
volumes:
- 'itam.example.com_db:/var/lib/mysql'
itam.example.com_website:
container_name: itam.example.com_website
image: snipe/snipe-it:v6.1.0-pre
; image: snipe/snipe-it:v6.0.1
; image: snipe/snipe-it:latest
restart: always
env_file: snipeit/itam.example.com.env
networks:
- 'sme-tier'
ports:
- 8001:80
volumes:
- 'itam.example.com_website:/var/www/html'
depends_on:
- itam.example.com_db
links:
- itam.example.com_db:itam
please help. In theory, it would be enough to just stop the containers, delete the containers, delete the images, make a change to the docker-composer file and run docker-composer
What could be the problem for me? env: docker 2.14; os RockyLinux;
it worked . The problem was a bad volume (path) mount configuration. The data was written inside the container and the link was not visible from the docker host (outside)
One shot should explain everything.
Should be:
volumes:
- 'itam.example.com_website:/var/lib/snipeit'
I had a seemingly similar issue with the container not upgrading. I have some further builds on top of the basic image, and it turned out that docker compose doesn't rebuild on docker-compose up
. https://github.com/docker/compose/issues/1487
This led to the old container being used.
So I just needed to add an explicit docker-compose build
to my deployment script.
Debug mode
Describe the bug
updating the environment based on the instructions below leads to a number of errors and makes it impossible to perform the update
https://snipe-it.readme.io/docs/upgrading https://snipe-it.readme.io/docs/docker
Reproduction steps
1. Snipe-IT installation, stop old container, delete image, change docker-compose file (add e.g. :v6.0.14), run environment after that it will re-pull the latest Snipe-IT image version, Launching the new container, but connecting to the same storage volume.
Every time "noting to migrate..." and footer with version number is not changing
docker exec container_name composer install --no-dev --prefer-source
get multiple: Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 0 installs, 0 updates, 28 removals
In GitDownloader.php line 246:
Failed to execute git show-ref --head -d
fatal: unsafe repository ('/var/www/html/vendor/theseer/tokenizer' is owned by someone else) To add an exception for this directory, call:
nizer
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--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] [--] [...]
so... docker exec container_name git config --global --add safe.directory /var/www/html/vendor/theseer/token... etc..
after that.... one more time: docker exec container_name composer install --no-dev --prefer-source
Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 0 installs, 0 updates, 5 removals
and
RUNING: docker exec container_name composer dump-autoload Generating optimized autoload files
NOW running: docker exec container_name php artisan migrate --force even after cache clear etc..
still nothing to migrate... and version snipeIT in foother still the same... :(
How to upgrade SnipeIT in docker-compose env.???
Expected behavior
1. Snipe-IT installation, stop old container, delete image, change docker-compose file (add e.g. :v6.0.14), run environment after that it will re-pull the latest Snipe-IT image version, Launching the new container, but connecting to the same storage volume.
Every time "noting to migrate..." and footer with version number is not changing
docker exec container_name composer install --no-dev --prefer-source
get multiple: Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 0 installs, 0 updates, 28 removals
In GitDownloader.php line 246:
Failed to execute git show-ref --head -d
fatal: unsafe repository ('/var/www/html/vendor/theseer/tokenizer' is owned by someone else) To add an exception for this directory, call:
nizer
install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--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] [--] [...]
so... docker exec container_name git config --global --add safe.directory /var/www/html/vendor/theseer/token... etc..
after that.... one more time: docker exec container_name composer install --no-dev --prefer-source
Installing dependencies from lock file Verifying lock file contents can be installed on current platform. Package operations: 0 installs, 0 updates, 5 removals
and
[root@sme sme]# docker exec itam.mansoft.com.pl_website composer dump-autoload Generating optimized autoload files
Screenshots
No response
Snipe-IT Version
latest
Operating System
RockyLinux (RedHat)
Web Server
docker official image
PHP Version
8
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
No response