Skip to content

Commit 01ced07

Browse files
Zot-Registry (#5016)
* 'Add new script' * fix curl call * update json --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ <[email protected]>
1 parent 85e13c9 commit 01ced07

File tree

4 files changed

+165
-0
lines changed

4 files changed

+165
-0
lines changed

ct/headers/zot-registry

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
_____ __ ____ _ __
2+
/__ / ____ / /_ / __ \___ ____ _(_)____/ /________ __
3+
/ / / __ \/ __/_____/ /_/ / _ \/ __ `/ / ___/ __/ ___/ / / /
4+
/ /__/ /_/ / /_/_____/ _, _/ __/ /_/ / (__ ) /_/ / / /_/ /
5+
/____/\____/\__/ /_/ |_|\___/\__, /_/____/\__/_/ \__, /
6+
/____/ /____/

ct/zot-registry.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://zotregistry.dev/
7+
8+
APP="Zot-Registry"
9+
var_tags="${var_tags:-registry;oci}"
10+
var_cpu="${var_cpu:-1}"
11+
var_ram="${var_ram:-2048}"
12+
var_disk="${var_disk:-5}"
13+
var_os="${var_os:-debian}"
14+
var_version="${var_version:-12}"
15+
var_unprivileged="${var_unprivileged:-1}"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
27+
if [[ ! -f /usr/bin/zot ]]; then
28+
msg_error "No ${APP} installation found!"
29+
exit
30+
fi
31+
32+
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
33+
if [[ ! -f ~/.${APP} ]] || [[ "${RELEASE}" != "$(cat ~/.${APP})" ]]; then
34+
msg_info "Stopping Zot service"
35+
systemctl stop zot
36+
msg_ok "Stopped Zot service"
37+
38+
msg_info "Updating Zot to ${RELEASE}"
39+
curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot
40+
chmod +x /usr/bin/zot
41+
chown root:root /usr/bin/zot
42+
echo "${RELEASE}" >~/.${APP}
43+
systemctl restart zot
44+
msg_ok "Updated Zot to ${RELEASE}"
45+
else
46+
msg_ok "Zot is already up to date (${RELEASE})"
47+
fi
48+
49+
exit
50+
}
51+
52+
start
53+
build_container
54+
description
55+
56+
msg_ok "Completed Successfully!\n"
57+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
58+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
59+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8080${CL}"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "Zot Registry",
3+
"slug": "zot",
4+
"categories": [
5+
13
6+
],
7+
"date_created": "2025-06-05",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": false,
11+
"interface_port": 8080,
12+
"documentation": "https://zotregistry.dev/docs/intro/",
13+
"website": "https://zotregistry.dev/",
14+
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/zot-registry.webp",
15+
"config_path": "/etc/zot/config.json",
16+
"description": "Zot is a cloud-native OCI image registry focused on extensibility, maintainability, and performance. It supports advanced features such as Web UI, security scanning, authentication via htpasswd and OIDC, and more.",
17+
"install_methods": [
18+
{
19+
"type": "default",
20+
"script": "ct/zot-registry.sh",
21+
"resources": {
22+
"cpu": 1,
23+
"ram": 2048,
24+
"hdd": 5,
25+
"os": "Debian",
26+
"version": "12"
27+
}
28+
}
29+
],
30+
"default_credentials": {
31+
"username": null,
32+
"password": null
33+
},
34+
"notes": []
35+
}

install/zot-registry-install.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://zotregistry.dev/
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y apache2-utils
18+
msg_ok "Installed Dependencies"
19+
20+
msg_info "Installing Zot Registry"
21+
RELEASE=$(curl -fsSL https://api.github.com/repos/project-zot/zot/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
22+
curl -fsSL "https://github.com/project-zot/zot/releases/download/${RELEASE}/zot-linux-amd64" -o /usr/bin/zot
23+
chmod +x /usr/bin/zot
24+
chown root:root /usr/bin/zot
25+
mkdir -p /etc/zot
26+
curl -fsSL https://raw.githubusercontent.com/project-zot/zot/refs/heads/main/examples/config-ui.json -o /etc/zot/config.json
27+
ZOTPASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
28+
$STD htpasswd -b -B -c /etc/zot/htpasswd admin "$ZOTPASSWORD"
29+
{
30+
echo "Zot-Credentials"
31+
echo "Zot User: admin"
32+
echo "Zot Password: $ZOTPASSWORD"
33+
} >>~/zot.creds
34+
echo "${RELEASE}" >~/.${APP}
35+
msg_ok "Installed Zot Registry"
36+
37+
msg_info "Setup Service"
38+
cat <<EOF >/etc/systemd/system/zot.service
39+
[Unit]
40+
Description=OCI Distribution Registry
41+
Documentation=https://zotregistry.dev/
42+
After=network.target auditd.service local-fs.target
43+
44+
[Service]
45+
Type=simple
46+
ExecStart=/usr/bin/zot serve /etc/zot/config.json
47+
Restart=on-failure
48+
User=root
49+
LimitNOFILE=500000
50+
MemoryHigh=2G
51+
MemoryMax=4G
52+
53+
[Install]
54+
WantedBy=multi-user.target
55+
EOF
56+
systemctl enable -q --now zot
57+
msg_ok "Setup Service"
58+
59+
motd_ssh
60+
customize
61+
62+
msg_info "Cleaning up"
63+
$STD apt-get -y autoremove
64+
$STD apt-get -y autoclean
65+
msg_ok "Cleaned"

0 commit comments

Comments
 (0)