×

portainer Updating on Docker Standalone

hqy hqy 发表于2025-01-14 21:32:25 浏览37 评论0

抢沙发发表评论

https://docs.portainer.io/start/upgrade/docker


Updating on Docker Standalone

Always match the agent version to the Portainer Server version. In other words, when you're installing or updating to Portainer 2.21.5 make sure all of the agents are also on version 2.21.5.

If you are updating from the 1.x version of Portainer, you must first update to 2.0.0 before updating to the newest version or you will run into issues.

Before beginning any update, we highly recommend taking a backup of your current Portainer configuration.

Updating your Portainer Server

Starting from Portainer CE 2.9 and BE 2.10, HTTPS is enabled by default on port 9443. These instructions will configure Portainer to use 9443 for HTTPS and do not expose 9000 for HTTP. If you need to retain HTTP access, you can add:

-p 9000:9000

to your command.

You can also choose to completely disable HTTP after the update. Before you make Portainer HTTPS only, make sure you have all your Agents and Edge Agents already communicating with Portainer using HTTPS.

This article assumes that you used our recommended deployment scripts.

To update to the latest version of Portainer Server, use the following commands to stop then remove the old version. Your other applications/containers will not be removed.

docker stop portainer
docker rm portainer

Now that you have stopped and removed the old version of Portainer, you must ensure that you have the most up to date version of the image locally. You can do this with a docker pull command:

docker pull portainer/portainer-ce:2.21.5

Finally, deploy the updated version of Portainer:

docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:2.21.5

These docker run commands include opening port 8000 which is used for Edge Agent communication as included in our installation instructions. If you do not need this port open, you can remove it from the command.

To provide your own SSL certs you may use --sslcert and --sslkey flags as below to provide the certificate and key files. The certificate file needs to be the full chain and in PEM format. For example, for Business Edition:

docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:2.21.5 --sslcert /path/to/cert/portainer.crt --sslkey /path/to/cert/portainer.key

The newest version of Portainer will now be deployed on your system, using the persistent data from the previous version, and will also upgrade the Portainer database to the new version.

When the deployment is finished, go to https://your-server-address:9443 or http://your-server-address:9000 and log in. You should notice that the update notification has disappeared and the version number has been updated.

Agent-only upgrade

To update to the latest version of Portainer Agent, use the following commands to stop then remove the old version. Your other applications/containers will not be removed.

docker stop portainer_agent
docker rm portainer_agent

Next, pull the updated version of the image:

docker pull portainer/agent:2.21.5

Finally, start the agent with the updated image:

docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:2.21.5

If you have set a custom AGENT_SECRET on your Portainer Server instance (by specifying an AGENT_SECRET environment variable when starting the Portainer Server container) you must remember to explicitly provide the same secret to your Agent in the same way (as an environment variable) when updating your Agent:

-e AGENT_SECRET=yoursecret





Updating Portainer

Portainer releases contain new features and bug fixes so it's important to keep your installation up to date. We have tested and validated all Portainer version upgrades from 2.0.0 up to the latest release.

While it's possible that an untested unvalidated update path might work, we recommend that all update paths are tested and validated on a non-critical system before applying them to your production systems.

We added a backup and restore feature to Portainer BE 2.7 and strongly recommend that you take a backup of your Portainer instance before updating.

Starting with CE 2.9 and BE 2.10 Portainer is HTTPS enabled by default and uses port 9443 to serve the UI. HTTP can still be enabled on port 9000 if required.

Update order

In general, we recommend updating your Portainer Server deployment before you update the Portainer Agents. When we release new versions of Portainer we ensure that Portainer Server is able to talk to older versions of the Agent, and in most cases the reverse is true, but in some instances we make changes to the Agent that are not fully backward compatible with older versions of Portainer Server.

Updating Portainer

From within Portainer

Updating from within Portainer to STS versions (or within STS versions) is currently not available. Only LTS versions will be offered through the in-app update. To switch to or update to STS versions, follow the manual instructions below.

From 2.19, Business Edition users are able to update their Portainer installation directly from within Portainer. To do so, click the Update now link in the update notification in the bottom left of the Portainer UI.

In the confirmation dialog, click Start update to proceed with the update.

Remember to back up your Portainer installation before updating!

Manually update Portainer

If you would prefer to manually update your Portainer installation, choose your platform then follow the instructions:

Updating on Docker StandaloneUpdating on Docker SwarmUpdating on Kubernetes

If you are coming from the Portainer 1.x branch, there are steps you must follow in order to update successfully:

Updating from Portainer 1.x


Update the Portainer Agent

To update the standard (non-Edge) Portainer Agent, you can find instructions in the above platform-specific links (Docker Standalone, Docker Swarm, and Kubernetes).

If you are using the Portainer Edge Agent, we have specific update instructions for you:

Updating the Edge Agent


打赏

本文链接:https://www.kinber.cn/post/4633.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客