Home  >  Article  >  Operation and Maintenance  >  How to upgrade docker containers

How to upgrade docker containers

王林
王林Original
2020-04-14 14:27:178092browse

How to upgrade docker containers

Solution:

1. Upgrade Image

Just pull the latest data from the server.

docker pull quay.io/sameersbn/redmine:latest

2. Close the old container and delete

to the working directory/data, use docker-compose to close the first-level container

cd /data
docker-compose stop
docker rm data_redmine_1

3. Restart the new container

Due to the code upgrade, some new environment parameter configurations have been added

REDMINE_SECRET_TOKEN
DB_NAME

One of these two was prompted by the log, and the other found that after the service upgrade, the old user could not log in. I checked the reason. I found out that it was because the default value of the database name had changed. There are many other parameters that may be affected, so you need to take a closer look at the details page.

docker-compose start

4. Upgrade the database

docker exec -it data_redmine_1 bash
cd $WORKDIR
RAILS_ENV=production bundle exec rake db:migrate

Recommended tutorial: docker tutorial

The above is the detailed content of How to upgrade docker containers. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn