Skip to content

Commit

Permalink
fix: listen on loopback address (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Dec 23, 2023
1 parent 30fd2a7 commit 933182f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 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,7 +31,6 @@ 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
kill -9 "$(cat "${registry_pid}")" || true
Expand Down
1 change: 0 additions & 1 deletion oci/private/registry/zot_launcher.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ 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
kill -9 "$(cat "${registry_pid}")" || true
Expand Down

0 comments on commit 933182f

Please sign in to comment.