1
0
Fork 0

Merging upstream version 0.10.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 13:50:35 +01:00
parent 5bb53e823c
commit 5145e72015
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
5 changed files with 21 additions and 15 deletions

View file

@ -547,7 +547,9 @@ class ObjectDownloader:
if noztp:
self._disable_ztp(file_path=file_path)
def docker_import(self, image_name: str = "arista/ceos") -> None:
def docker_import(
self, image_name: str = "arista/ceos", is_latest: bool = False
) -> None:
"""
Import docker container to your docker server.
@ -561,6 +563,9 @@ class ObjectDownloader:
logger.info(f"Importing image {self.filename} to {docker_image}")
console.print(f"🚀 Importing image {self.filename} to {docker_image}")
os.system(f"$(which docker) import {self.filename} {docker_image}")
if is_latest:
console.print(f"🚀 Configuring {docker_image}:{self.version} to be latest")
os.system(f"$(which docker) tag {docker_image} {image_name}:latest")
for filename in glob.glob(f"{self.filename}*"):
try:
os.remove(filename)