Hi all, I’m trying to publish my docker image with...
# general
j
Hi all, I’m trying to publish my docker image with pants publish, however, I got this error:
Copy code
14:25:36.73 [DEBUG] spawned local process as Some(35313) for Process { argv: ["/usr/local/bin/docker", "build", "--pull=False", "--tag", "us-docker.pkg.dev/xx/containers/text-alignment:latest", "--file", "text-alignment/Dockerfile", "."], env: {"DOCKER_CONFIG": "/Users/xx/.docker", "PATH": "/tmp/pants-sandbox-cPOlym/xx", "__UPSTREAM_IMAGE_IDS": ""}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<xx>, size_bytes: 243 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<xx>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<xx>, size_bytes: 89 }, tree: "Some(..)" }, immutable_inputs: {RelativePath("xx"): DirectoryDigest { digest: Digest { hash: Fingerprint<xx>, size_bytes: 488 }, tree: "Some(..)" }}, use_nailgun: {} }, output_files: {}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Building docker image us-docker.pkg.dev/xx/containers/text-alignment:latest", level: Info, append_only_caches: {}, jdk_home: None, cache_scope: PerSession, execution_environment: ProcessExecutionEnvironment { name: None, platform: Linux_arm64, strategy: Local }, remote_cache_speculation_delay: 0ns }

stderr:
ERROR: unknown flag: --pull
can someone help me understand what’s the problem and how to fix it?
1
b
An error like that sounds like
/usr/local/bin/docker
doesn't support a flag pants expects. Pants is mostly a thin wrapper for running tools like that, but can have minimum versions of the tool, if there's new features required. For debugging this, you can look at that that docker binary, e.g. check
docker build --help
and see if
--pull
is listed, and maybe then look at
docker --version
too. In general, https://www.pantsbuild.org/docs/troubleshooting#debug-tip-inspect-the-sandbox-with---keep-sandboxes is great for investigating issues, by jumping into the sandbox and seeing/editing what pants ran
j
thanks! it turned out since I’m using a virtual machine, so the docker config was configured to read from my host machine. Updating the config path fixed the issue. thanks!