Unanttended Upgrade Docker

To configure unattended upgrades for Docker on a Debian-based system, you can add the following line to the 50unattended-upgrades file. This will ensure that Docker packages are automatically updated when unattended-upgrades runs.

Here are the steps to do this:

  1. Open a terminal on your Debian-based system.

  2. Use a text editor to open the 50unattended-upgrades file for editing. You’ll typically find this file in the /etc/apt/apt.conf.d/ directory.

1
sudo nano /etc/apt/apt.conf.d/50unattended-upgrades
  1. Add the following line to the file, which specifies that Docker packages should be automatically upgraded:
1
2
3
4
5
Unattended-Upgrade::Allowed-Origins {
    "${distro_id}:${distro_codename}-security";
    "${distro_id}:${distro_codename}-updates";
    "Docker:${distro_codename}";
};

This configuration tells unattended-upgrades to include the Docker repository for automatic updates, in addition to the security and regular updates repositories for your distribution.

  1. Save the file by pressing Ctrl + O, then press Enter. Exit the text editor by pressing Ctrl + X.

  2. To make sure your changes take effect, run the following command:

1
sudo unattended-upgrades --dry-run --debug

This command will simulate an unattended upgrade run and display any errors or issues it encounters. Ensure there are no errors related to your Docker configuration.

Now, unattended-upgrades will automatically include Docker packages in its upgrade process based on your specified configuration.

Remember that unattended upgrades can automatically update packages, including Docker, without requiring manual intervention. Make sure this aligns with your system’s update policy and that you have backups and a way to monitor the system in case issues arise from automatic updates.

0%