Issue deploying new sinatra app

Hi everyone!

I was going through this runbook Run a Ruby App · Fly Docs to deploy a Sinatra app.

When I run the command flyctl launch I’m getting this error when pulling the docker image.

==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
20: Pulling from heroku/buildpacks
7608715873ec: Pull complete
49eacad9cd1e: Pull complete
5d0b2919d84d: Pull complete
fa0988475b08: Pull complete
ae48c9acc959: Pull complete
a3e5499f42c1: Pull complete
ee5aff81b2af: Pull complete
70e0bea64ce8: Pull complete
682fcfb7094c: Pull complete
f10dea63a38d: Pull complete
12aff8b49586: Pull complete
1934b29fc644: Pull complete
afcf4d4a523c: Pull complete
210536913458: Pull complete
3e16de7dad49: Pull complete
631116a8a8a0: Pull complete
0836f8ecffda: Pull complete
a9816ab34f56: Pull complete
1e9746f88697: Pull complete
b3a82b74322b: Pull complete
8302b240c14a: Pull complete
acfb69560bf5: Pull complete
a58b8a02086c: Pull complete
51d3dad37b08: Pull complete
89748488e2f9: Pull complete
38a309e2fccd: Pull complete
9804be873c4f: Pull complete
289c6d76c467: Pull complete
8381ed846c61: Pull complete
d380858d7954: Pull complete
4f4fb700ef54: Downloading
Error failed to fetch an image or build from source: failed to fetch builder image 'index.docker.io/heroku/buildpacks:20': Head "https://registry-1.docker.io/v2/heroku/buildpacks/manifests/20": unauthorized: incorrect username or password

The flyctl version is 0.0.456.

Thank you in advance for the help.

Let’s try a Dockerfile instead. I can help optimize this later, but remove the [build] section from your fly.toml, create a file named Dockerfile with the following contents, and then try fly deploy again:

ARG RUBY_VERSION=3.2.1
FROM ruby:$RUBY_VERSION-slim as base

WORKDIR /sinatra

RUN apt-get update -qq && \
    apt-get install --no-install-recommends -y build-essential

COPY Gemfile* .

RUN bundle install

COPY . .

EXPOSE 8080

CMD ["rackup", "--host", "0.0.0.0", "--port", "8080"]

Adjust the value of RUBY_VERSION to match what you are using locally.

1 Like

Thank you, that worked!