Hi there,
I am attempting to deploy a Flask-based machine learning application, and I have followed the instructions in the documentation to execute ‘fly deploy’. However, after multiple attempts, the deployment fails consistently when transferring context, reaching 600~700MB. Below is the error message provided:
Error: failed to fetch an image or build from source: error building: failed to receive status: rpc error: code = Unavailable desc = error reading from server: read unix @->C:\Users\green.fly\fly-agent.sock: wsarecv: An existing connection was forcibly closed by the remote host.ocker/dockerfile:1
Here is my Dockfile and the result of running ‘fly doctor’.
Dockfile:
syntax = docker/dockerfile:1
ARG PYTHON_VERSION=3.8.19
FROM python:${PYTHON_VERSION}-slim
LABEL fly_launch_runtime=“flask”
WORKDIR /code
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txtCOPY . .
EXPOSE 8080
CMD [ “python3”, “-m” , “flask”, “run”, “–host=0.0.0.0”, “–port=8080”]
fly doctor:
Testing authentication token… PASSED
Testing flyctl agent… PASSED
Testing local Docker instance… Nope
Pinging WireGuard gateway (give us a sec)… PASSED
Testing WireGuard DNS… PASSED
Testing WireGuard Flaps… PASSEDApp specific checks for js-test-cold-shadow-4331:
Checking that app has ip addresses allocated… Nope
No ip addresses assigned to this app. If the app is not intended to receive traffic, this is fine.
Otherwise, it likely means that the services configuration is not correctly setup to receive http, tls, tcp, or udp traffic.
Fly Launch configuration (fly.toml) · Fly Docs
No public ipv4 or ipv6 ip addresses allocated to app js-test-cold-shadow-4331Build checks for js-test-cold-shadow-4331:
Checking docker context size (this may take little bit)… PASSED (1.6 GB)
Checking for .dockerignore… Nope
Found no .dockerignore to limit docker context size. Large docker contexts can slow down builds.
Create a .dockerignore file to indicate which files and directories may be ignored when building the docker image for this app.
More info at: Dockerfile reference | Docker Docs
Has anyone encountered a similar issue and found a solution? I believe it might be a network-related problem, but I haven’t been able to find a corresponding solution. Thank you.