I have an extremely simple Dockerfile and fly.toml (I’ll paste them at the bottom of this post). However, when I try to deploy my image to a Fly machine, the deploy logs show that my start script can’t be found:
05:41:20
ERROR Error: failed to spawn command: /usr/local/bin/start.sh: No such file or directory (os error 2)
05:41:20
does `/usr/local/bin/start.sh` exist and is it executable?
The start.sh script absolutely does exist - I’ve pulled the image being used down locally (via fly auth docker and fly image show), and poked around in the image. Not only does the start.sh script exist, but when I run the image on my local machine it finds the script and starts up just fine.
This seems like it could be the same thing as Docker image works locally, but not on Fly.io; getting `command not found` - #17 by mboyea ? But I tried the solution from that thread (manually setting PATH in the [[env]] section of fly.toml) and it didn’t resolve the issue.
This is extremely frustrating, I can’t figure out what is going wrong or how to fix it.
Here’s my Dockerfile:
FROM debian:bookworm-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
iproute2 \
iptables \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://opencode.ai/install | bash
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscaled /app/tailscaled
COPY --from=docker.io/tailscale/tailscale:stable /usr/local/bin/tailscale /app/tailscale
RUN mkdir -p /var/run/tailscale /var/cache/tailscale /var/lib/tailscale
RUN mkdir -p /data/workspace
WORKDIR /data/workspace
COPY start.sh /usr/local/bin/start.sh
RUN chmod +x /usr/local/bin/start.sh
EXPOSE 4096
ENV PATH="/root/.local/bin:${PATH}"
ENV XDG_DATA_HOME=/data
CMD ["/usr/local/bin/start.sh"]
and my fly.toml:
app = "opencode-nova"
primary_region = "ewr"
[build]
dockerfile = "Dockerfile"
[env]
OPENCODE_PORT = "4096"
XDG_DATA_HOME = "/data"
TAILSCALE_HOSTNAME = "nova"
[[mounts]]
source = "opencode_data"
destination = "/data"
Am I missing something obvious?