You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行ZAP API扫描命令时提示无法找到'in:latest'镜像的问题求助

Fixing "unable to find image 'in:latest' locally" Error with ZAP API Scan on Docker (Mac)

That error pops up because Docker's parameter parser gets confused by unquoted whitespace in your current directory path — it splits the -v mount argument into multiple parts, and ends up misinterpreting one of those fragments as an image name (in:latest). Here's how to fix it step by step:

Step 1: Quote the Current Directory Path

Wrap $(pwd) in double quotes to stop whitespace from breaking the mount argument. This is the most common fix for this issue on Mac:

docker run -v /etc/hosts:/etc/hosts -v "$(pwd)":/zap/wrk:rw -t owasp/zap2docker-weekly zap-api-scan.py -t myapitest.json -f openapi

Without quotes, if your working directory has spaces (like ~/My API Projects/Tests), $(pwd) expands to multiple separate words. Docker then treats the word after the space as a new image name instead of part of the mount flag.

Step 2: Verify Your Local JSON File Exists

Make sure myapitest.json is actually in the directory where you're running the command. Since you're mounting your current directory to /zap/wrk in the container, ZAP will look for the file at /zap/wrk/myapitest.json — if it's missing, you'll hit another error after fixing the image issue.

Step 3: Simplify to Rule Out Other Variables

If you're still stuck, strip down the command first to eliminate extra variables:

# Test without the /etc/hosts mount first
docker run -v "$(pwd)":/zap/wrk:rw -t owasp/zap2docker-weekly zap-api-scan.py -t myapitest.json -f openapi

If this works, add back the /etc/hosts mount — it's unlikely to cause the image error, but narrowing down variables helps pinpoint issues faster.

Optional: Refresh the ZAP Docker Image

If you haven't pulled the latest weekly image in a while, refresh it to avoid any outdated image quirks:

docker pull owasp/zap2docker-weekly

内容的提问来源于stack exchange,提问作者Alex

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:46:05