#docker: Error response from daemon: No command specified

1 messages · Page 1 of 1 (latest)

pale pumice
analog inlet
#

Hey, I'm taking a look.

#

There's an argument in the command that jumped out to me: "--access-logfile -", should be split in two.

#

Btw, you'll need to change the optional to a kwarg because otherwise it's going to break in the next release .with_default_args(args=[...]).

pale pumice
#

Tried to split in two but same issue

analog inlet
#

Do it anyway, the problem is elsewhere.

pale pumice
#

Ah didn't add the args=[..]

analog inlet
#

I'll need to strip down your code to a minimal example since I don't have your files.

analog inlet
#

I ran a simpler version (without stuff from src) successfully. Can you provide the command you're using and what you get in the logs?

#

This is what I ran:

import sys
import anyio
import dagger
import os


async def main():
    # Create Dagger Client
    async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
        deploy_image = os.getenv("PYTHON_IMAGE", "python:3.10-slim")

        # map root project folder as src folder
        src = client.host().directory(".")

        # base pipeline with required Python packages
        build = (
            client.container().pipeline("build")
            .from_(deploy_image)
            .with_mounted_cache("/root/.cache", client.cache_volume("pip"))
            .with_mounted_directory("/src", src)
            .with_workdir("/src")
            .with_exec(["pip", "install", "."])
        )

        deploy = (
            client.container()
            .pipeline("deploy")
            .from_(deploy_image)
            .with_env_variable("PYTHONPATH", "/")
            .with_directory(
                "/usr/local/lib/python3.10/site-packages",
                build.directory("/usr/local/lib/python3.10/site-packages"),
            )
            .with_exposed_port(8080)
            .with_default_args(
                args=[
                    "whoami",
                ]
            )
        )

        await deploy.export("/tmp/kea-netbox-helper.tar")


if __name__ == "__main__":
    anyio.run(main)
#

Oh, you said the error is when importing... you mean into the docker engine?

pale pumice
#

yes, after importing in docker engine

#
docker import /tmp/kea-netbox-helper.tar
docker run --rm <image_id>
docker: Error response from daemon: No command specified.
See 'docker run --help'.
analog inlet
#
❯ docker load -i /tmp/kea-netbox-helper.tar
efd1965f1684: Loading layer [==================================================>]  29.15MB/29.15MB
1895af3a999f: Loading layer [==================================================>]  3.321MB/3.321MB
01dee7757be9: Loading layer [==================================================>]  16.41MB/16.41MB
b9ba805c6ff3: Loading layer [==================================================>]     244B/244B
e7902a4f70d5: Loading layer [==================================================>]  3.367MB/3.367MB
fce6b3c56c83: Loading layer [==================================================>]  7.608MB/7.608MB
Loaded image ID: sha256:ffb5de52e24e8334dfb077ed2930e40211b145c002c4512ec1c9dc82ad5da164
pale pumice
#

Nevermind

#

should have used docker load rather than docker import

analog inlet
#

Ah yes, import is just he filesystem.

pale pumice
#

Thanks for clearing this up. Didn't had much sleep... 😴

analog inlet
#

That's alright, me neither! 🙂