Reputation: 1034
We are trying to upgrade docker container to latest image.
Here is the process i am trying to follow.
Below are the step i thought i will follow.
The problem I am facing is i don't know how to use output of "Docker Inspect" command while creating container.
Upvotes: 1
Views: 4734
Reputation: 39237
What you should have done in the first place:
In production environments, with lots of containers, You will lose track of docker run
commands. In order to keep up with complexity, Use docker-compose
.
First you need to install docker-compose
. Refer to official documents for that.
Then create a yaml
file, describing your environment. You can specify more than one container (for apps that require multiple services, for example nginx
,php-fpm
and mysql
)
Now doing all that, When you want to upgrade containers to newer versions, you just change the version in the yaml file, and do a docker-compose down
and docker-compose up
.
Refer to compose documentation for more info.
What to do now:
Start by reading docker inspect
output. Then gather facts:
Then try to create docker-compose
yaml file with those facts on a test machine, and test your setup.
When confident enough, Roll it in production and keep latest compose yaml for later reference.
Upvotes: 2