MulaiMulai sekarang secara gratis

Keeping packages up-to-date

Keeping Docker images up-to-date makes them more secure because applications might have released security updates since the image was released. This means even when using an image from a trusted source, we should update all the software on the image before using it in a production environment.

Exactly how you can update all software on an image depends on the image and its operating system. Let's learn how to update all packages on Ubuntu using the apt-get package.

  • First, start a container from the ubuntu image while setting the correct flag to get an interactive session in the container.
  • In the Ubuntu container, run apt-get update to make the apt-get package manager check if any updates are available for any packages.
  • Run apt-get upgrade to upgrade all installed packages.

Before confirming the upgrade, you'll be able to see the various reasons the package will be changed. What are the reasons?

Latihan ini adalah bagian dari kursus

Introduction to Docker

Lihat Kursus

Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga