Running docker container fails when deploying new app

Hello, very new to fly.io (and deployment in general). I am attempting to deploy a ruby on rails (api only) application using fly deploy and the process seems to hang on Status: Image is up to date for heroku/pack:20 for about 15-20 mins. before finally failing with this error - Error executing lifecycle: io: read/write on closed pipe.

Here are the debug logs from my terminal output -

...
Remote builder fly-builder-winter-star-8802 ready
==> Building image with Buildpacks
--> docker host: 20.10.12 linux x86_64
Pulling image index.docker.io/heroku/buildpacks:20
20: Pulling from heroku/buildpacks
Digest: sha256:9e65f3cbaa3d2d1fd9596d37a4bba7db0c95d459e46390e0d895333e8f2e9692
Status: Image is up to date for heroku/buildpacks:20
Selected run image heroku/pack:20
Pulling image heroku/pack:20
20: Pulling from heroku/pack
Digest: sha256:0963727f02c1d8e0e9c72f993e7580db693ab73d6df8b0b99ddcd1d23f193df3
Status: Image is up to date for heroku/pack:20
Creating builder with the following buildpacks:
-> heroku/java@0.3.14
-> heroku/maven@0.2.5
-> heroku/procfile@0.6.2
-> heroku/gradle@0.0.35
-> heroku/jvm@0.1.12
-> heroku/scala@0.0.90
-> heroku/java-function@0.3.26
-> heroku/jvm-function-invoker@0.6.0
-> heroku/maven@0.2.5
-> heroku/jvm@0.1.12
-> heroku/ruby@0.1.3
-> heroku/procfile@0.6.2
-> heroku/python@0.3.1
-> heroku/php@0.3.1
-> heroku/go@0.3.1
-> heroku/nodejs@0.4.1
-> heroku/nodejs-engine@0.7.5
-> heroku/nodejs-npm@0.4.5
-> heroku/nodejs-yarn@0.1.8
-> heroku/procfile@0.6.2
-> heroku/nodejs-function@0.7.1
-> heroku/nodejs-engine@0.7.5
-> heroku/nodejs-function-invoker@0.2.8
-> heroku/nodejs-npm@0.4.5
Using build cache volume pack-cache-museumer-api-2022_cache-963d967a04a8.build
Running the creator on OS linux with:
Container Settings:
  Args: /cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image heroku/pack:20 -tag registry.fly.io/museumer-api-2022:deployment-1644178616 -gid 0 registry.fly.io/museumer-api-2022:cache
  System Envs: CNB_PLATFORM_API=0.6
  Image: pack.local/builder/6c776b7a64666e6b757a:latest
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: pack-cache-museumer-api-2022_cache-963d967a04a8.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-museumer-api-2022_cache-963d967a04a8.launch:/launch-cache pack-layers-quwpbiucnq:/layers pack-app-qptwozdblh:/workspace
  Network Mode: 
DEBUG result image:<nil> error:executing lifecycle: io: read/write on closed pipe
Error executing lifecycle: io: read/write on closed pipe

My fly.toml file -

# fly.toml file generated for museumer-api-2022 on 2022-02-06T14:33:52-05:00

app = "museumer-api-2022"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[build]
  builder = "heroku/buildpacks:20"

[deploy]
  release_command = "bundle exec rails db:migrate"

[env]
  PORT = "8080"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

and my Dockerfile -

# syntax = docker/dockerfile:experimental

ARG RUBY_VERSION=2.7.2-jemalloc
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-slim as build

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ARG RAILS_MASTER_KEY
ENV RAILS_MASTER_KEY=${RAILS_MASTER_KEY}

ARG DOCKER_BUILDKIT=1
ENV DOCKER_BUILDKIT=${DOCKER_BUILDKIT}

ENV PATH $PATH:/usr/local/bin

ENV BUNDLE_WITHOUT development:test
ENV BUNDLE_PATH vendor/bundle

RUN mkdir /app
WORKDIR /app

# Reinstall runtime dependencies that need to be installed as packages

RUN --mount=type=cache,id=apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    git build-essential libpq-dev wget vim curl gzip xz-utils \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

RUN gem install -N bundler -v 2.2.32

# Install rubygems
COPY Gemfile* ./
RUN bundle install

COPY . .

RUN bundle exec rails assets:precompile

RUN rm -rf vendor/bundle/ruby/*/cache

FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-slim

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}
ENV RAILS_SERVE_STATIC_FILES true
ENV BUNDLE_PATH vendor/bundle
ENV BUNDLE_WITHOUT development:test
ENV RAILS_MASTER_KEY=${RAILS_MASTER_KEY}

RUN --mount=type=cache,id=apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    postgresql-client file vim curl gzip \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

COPY --from=build /app /app

WORKDIR /app

RUN mkdir -p tmp/pids

EXPOSE 8080

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

Any suggestions/help would be greatly appreciated. Thank you!

Sorry for the confusion here. The Dockerfile isn’t actually being used here - the builder section of fly.toml takes control of the deployment. In our latest CLI version, we no longer place the Dockerfile.

I’m not sure what the specific problem here is. Sometimes the Heroku buildpack process can stall. Can you try running it again to see if you get the same results?