Skip to content

Refactor: Zot-Registry #6822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions ct/zot-registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,29 @@ function update_script() {
header_info
check_container_storage
check_container_resources

if [[ ! -f /usr/bin/zot ]]; then
msg_error "No ${APP} installation found!"
exit
fi

RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4)}')
if [[ ! -f ~/.${APP} ]] || [[ "${RELEASE}" != "$(cat ~/.${APP})" ]]; then
msg_info "Stopping Zot service"
systemctl stop zot
msg_ok "Stopped Zot service"

msg_info "Updating Zot to ${RELEASE}"
curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot
chmod +x /usr/bin/zot
rm -f /usr/bin/zot
fetch_and_deploy_gh_release "zot" "project-zot/zot" "singlefile" "latest" "/usr/bin" "zot-linux-amd64"

msg_info "Configuring Zot Registry"
chown root:root /usr/bin/zot
echo "${RELEASE}" >~/.${APP}
systemctl restart zot
msg_ok "Updated Zot to ${RELEASE}"
msg_ok "Configured Zot Registry"

msg_info "Starting service"
systemctl start zot
msg_ok "Service started"

msg_ok "Updated successfuly"
else
msg_ok "Zot is already up to date (${RELEASE})"
fi
Expand Down
11 changes: 4 additions & 7 deletions install/zot-registry-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ msg_info "Installing Dependencies"
$STD apt-get install -y apache2-utils
msg_ok "Installed Dependencies"

msg_info "Installing Zot Registry"
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot
chmod +x /usr/bin/zot
chown root:root /usr/bin/zot
fetch_and_deploy_gh_release "zot" "project-zot/zot" "singlefile" "latest" "/usr/bin" "zot-linux-amd64"

msg_info "Configuring Zot Registry"
mkdir -p /etc/zot
curl -fsSL https://raw.githubusercontent.com/project-zot/zot/refs/heads/main/examples/config-ui.json -o /etc/zot/config.json
ZOTPASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
Expand All @@ -31,8 +29,7 @@ $STD htpasswd -b -B -c /etc/zot/htpasswd admin "$ZOTPASSWORD"
echo "Zot User: admin"
echo "Zot Password: $ZOTPASSWORD"
} >>~/zot.creds
echo "${RELEASE}" >~/.${APPLICATION}
msg_ok "Installed Zot Registry"
msg_ok "Configured Zot Registry"

msg_info "Setup Service"
cat <<EOF >/etc/systemd/system/zot.service
Expand Down