shalvah-gs
(Shalvah Adebayo)
February 12, 2024, 6:35pm
1
When deploying a Docker container from a Git repo, how does Qovery generate the image tag in the configured container registries? ie lines like these in the logs:
Checking if image already exists remotely ....ecr.eu-central-1.amazonaws.com/xxxxxxxxxxxxxx
How is the image tag generated (the xxxxxxxxxxxxxx
)? I assumed it would use the Git commit, but that doesn’t seem to be the case.
rophilogene
(Romaric Philogene)
February 28, 2024, 12:30pm
2
Hi @shalvah-gs ,
Indeed, we don’t use the git commit ID to tag the image but an internal Qovery ID. You can find the detailed code here .
let image_to_build = ContainerImage::new(
build.image.registry_url.clone(),
build.image.name(),
vec![build.image.tag.clone(), "latest".to_string()],
);
let image_cache =
ContainerImage::new(build.image.registry_url.clone(), build.image.name(), vec!["latest".to_string()]);
// Check if the image does not exist already remotely, if yes, we skip the build
let image_name = image_to_build.image_name();
logger.send_progress(format!("🕵️ Checking if image already exists remotely {image_name}"));
if let Ok(true) = self.context.docker.does_image_exist_remotely(&image_to_build) {
logger.send_progress(format!("🎯 Skipping build. Image already exists in the registry {image_name}"));
build_record.stop(StepStatus::Skip);
// skip build
return Ok(());
}
logger.send_progress(format!("⛏️ Building image. It does not exist remotely {image_name}"));
image_to_build.image_name()
details is here .
let host = self.host_with_port();
match &self.id {
ImageId::Digest(digest) => vec![format!("{}/{}@{}", host, &self.name, digest)],
ImageId::Tags(tags) => tags
.iter()
.map(|tag| format!("{}/{}:{}", host, &self.name, tag))
.collect(),
}
}
pub fn image_name(&self) -> String {
self.image_names().remove(0)
}
pub fn repository_with_host(&self) -> String {
format!("{}/{}", self.host_with_port(), self.name)
}
}
#[derive(Debug, Clone)]
enum BuilderLocation {
If you explain to me what you need, I’ll try to guide you in a more precise way.
1 Like
system
(system)
Closed
March 26, 2024, 10:50am
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.