Skip to content

Commit

Permalink
fix: listen on loopback address
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Dec 18, 2023
1 parent 7392c5b commit f5eb3b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 2 additions & 7 deletions oci/private/registry/crane_launcher.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ function start_registry() {
local registry_pid="$1/proc.pid"
mkdir -p "${storage_dir}"
# --blobs-to-disk uses go's os.TempDir() function which is equal to TMPDIR under *nix.
# https://pkg.go.dev/os#TempDir
TMPDIR="${storage_dir}" TMP="${storage_dir}" \
"${CRANE_REGISTRY_BIN}" registry serve --blobs-to-disk >> $output 2>&1 &
"${CRANE_REGISTRY_BIN}" registry serve --disk="${storage_dir}" --address=localhost:0 >> $output 2>&1 &
echo "$!" > "${registry_pid}"
local timeout=$((SECONDS+${deadline}))

while [ "${SECONDS}" -lt "${timeout}" ]; do
Expand All @@ -34,10 +31,8 @@ function stop_registry() {
local storage_dir="$1"
local registry_pid="$1/proc.pid"
if [[ ! -f "${registry_pid}" ]]; then
echo "Registry not started" >&2
return 0
fi
echo "Stopping registry process" >&2
kill -9 "$(cat "${registry_pid}")" || true
return 0
}
2 changes: 0 additions & 2 deletions oci/private/registry/zot_launcher.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ function stop_registry() {
local storage_dir="$1"
local registry_pid="$1/proc.pid"
if [[ ! -f "${registry_pid}" ]]; then
echo "Registry not started" >&2
return 0
fi
echo "Stopping registry process" >&2
kill -9 "$(cat "${registry_pid}")" || true
return 0
}

0 comments on commit f5eb3b2

Please sign in to comment.