Hey, wizards, I'm trying to deploy using command l...
# ask-community
m
Hey, wizards, I'm trying to deploy using command line/yaml file. I have customized Dockerfile and my Docker Desktop is running.. I get this error: requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localnpipe/v1.44/images/sha256:....
n
hi @Mao Li - can you show more of what you're trying as it relates to Prefect? ie what CLI commands are you using
m
Hey I'm using command:
prefect deploy .\main.py:<flow_func_name>
I already have a customized Dockerfile in the root directory of the project
n
what does your
prefect.yaml
definition look like?
m
I don't have one yet, I have the impression that the command will create one if it's not present. no ?
n
prefect init
will do that
m
I see. let me try that
running init to generate the yaml file enabled the deployment, thanks
Another question: my Dockerfile has this line to copy the code:
Copy code
# Add our flow code to the image
COPY . /opt/
and my yaml looks like this:
Copy code
pull:
- prefect.deployments.steps.set_working_directory:
    directory: /opt
still, when I run, I get this: FileNotFoundError: [Errno 2] No such file or directory: '/opt/main.py'
What did I do wrong?
n
not sure, sorry cant look more right now but here's some examples • prefect.yaml defintion w set work dir • corresponding dockerfile
m
gotcha, thanks