Skip to content

Commit f5eb3b2

Browse files
committed
fix: listen on loopback address
1 parent 7392c5b commit f5eb3b2

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

oci/private/registry/crane_launcher.sh.tpl

+2-7
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ function start_registry() {
88
local registry_pid="$1/proc.pid"
99
1010
mkdir -p "${storage_dir}"
11-
# --blobs-to-disk uses go's os.TempDir() function which is equal to TMPDIR under *nix.
12-
# https://pkg.go.dev/os#TempDir
13-
TMPDIR="${storage_dir}" TMP="${storage_dir}" \
14-
"${CRANE_REGISTRY_BIN}" registry serve --blobs-to-disk >> $output 2>&1 &
11+
"${CRANE_REGISTRY_BIN}" registry serve --disk="${storage_dir}" --address=localhost:0 >> $output 2>&1 &
1512
echo "$!" > "${registry_pid}"
16-
13+
1714
local timeout=$((SECONDS+${deadline}))
1815

1916
while [ "${SECONDS}" -lt "${timeout}" ]; do
@@ -34,10 +31,8 @@ function stop_registry() {
3431
local storage_dir="$1"
3532
local registry_pid="$1/proc.pid"
3633
if [[ ! -f "${registry_pid}" ]]; then
37-
echo "Registry not started" >&2
3834
return 0
3935
fi
40-
echo "Stopping registry process" >&2
4136
kill -9 "$(cat "${registry_pid}")" || true
4237
return 0
4338
}

oci/private/registry/zot_launcher.sh.tpl

-2
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ function stop_registry() {
3939
local storage_dir="$1"
4040
local registry_pid="$1/proc.pid"
4141
if [[ ! -f "${registry_pid}" ]]; then
42-
echo "Registry not started" >&2
4342
return 0
4443
fi
45-
echo "Stopping registry process" >&2
4644
kill -9 "$(cat "${registry_pid}")" || true
4745
return 0
4846
}

0 commit comments

Comments
 (0)