Dino Geek, try to help you

How to rollback in Docker?


Docker itself does not provide a specific command to rollback to a previous version of a container or image. However, you can achieve a similar effect by using Docker’s tagging and versioning system. Here are the steps to do that:

1. Tag your images: Whenever you build a new image of your application, tag it with a version number.

\`\`\`bash $ docker build -t myapp:1.0 . \`\`\`

1. Run the specific versions: When you run a container from the image, specify the version that you want to use.

\`\`\`bash $ docker run -d -p 80:80 myapp:1.0 \`\`\`

1. Change versions: If you want to rollback to a previous version, you can simply stop the current container and start a new one from the older image.

\`\`\`bash $ docker stop myapp\_container $ docker rm myapp\_container $ docker run -d -p 80:80 myapp:0.9 \`\`\`

This method needs that you keep versions of your application as separate Docker images and takes care about not deleting old ones.

Alternatively, you can create an specific system inside your application that allows rollbacks, and put it inside your container. Or you can use solutions like Kubernetes that provides a more complex system to manage containers and versions.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use