I would like to have a general approach how to upd...
# docker
a
I would like to have a general approach how to update spryker in docker enviroment. And not to destory the container every time. Loosing the database and installing againg.
q
@high-pencil-62400?
p
Hi Robert, Let me clarify your setup and what you are trying to achieve. So, as I understand, you have DB instance inside a container and NOT as a managed service, right? Are you talking about local development environment or production?
a
Hi @plain-barista-64036 i would like to solve both environments. And yes my setup is totally build with the docker/sdk. Thanks
???
q
@plain-barista-64036?
p
I am asking for more time to evaluate this topic. I need to discuss this with my team first. And I will come back to you soon
Robert, I forgot to ask. Are you using PostgreSQL or MySQL?
Hi Robert, Small update from our side. At the moment, there is no support for updating DB versions AND keeping the data in docker-sdk. But you can try to use the following guidelines to do that manually: PostgreSQL:
Copy code
1. docker exec spryker_demo_database_1 pg_dumpall -U root > dump.sql
2. docker/sdk down
3. docker volume rm spryker_demo_database-postgres-data
4. Change version into docker/deployment/default/docker-compose.yml for database
5. docker/sdk run
6. docker cp dump.sql spryker_demo_database_1:/var/lib/postgresql/data
7. docker exec -it spryker_demo_database_1 bash
8. psql -U root < /var/lib/postgresql/data/dump.sql
For MySQL:
Copy code
1. Change version into docker/deployment/default/docker-compose.yml for database
2. Change config volume:-  ./${DEPLOYMENT_PATH}/context/mysql/my.cnf:/etc/mysql/mysql.conf.d/my.cnf:ro
3. docker/sdk run
I hope this helps. And thank you for your questions. We will consider this functionality to be part of our product. Dmytro
And of course, when you update your local setup and only project code is involved, then only the required images will be rebuilt (e.g. Yves, Zed)