runfinch / finch

The Finch CLI is an open source client for container development
https://www.runfinch.com
Apache License 2.0
3.59k stars 95 forks source link

Feedback: Slow build #702

Open dlaidlaw opened 1 year ago

dlaidlaw commented 1 year ago

Describe the bug Not so much a bug as feedback about a step that is extremely slow compared to the equivalent docker command.

Just providing this is feedback for what I have experienced in a typical usage.

Steps to reproduce finch build . -t al2023:finch vs docker build . -t al2023:docker

See below for the Dockerfile.

Expected behavior The build command to finish in near the same amount of time as the equivalent docker command.

The RUN dnf line of the Dockerfile (line 4) took:

With finch: 4572 seconds. (one hour, 18 minutes) With Docker: 50 seconds

Screenshots or logs

finch-support-20231122131420.zip

Additional context

Running on Mac OS

The Dockerfile:

FROM public.ecr.aws/amazonlinux/amazonlinux:2023 as build

RUN mkdir /sysroot
RUN dnf --releasever=$(rpm -q system-release --qf '%{VERSION}') \
  --installroot /sysroot \
  -y \
  --setopt=install_weak_deps=False \
  install \
  bash awscli-2 openssl openssl-devel wget jq unzip tar gzip vim nano bash-completion less findutils

FROM scratch
COPY --from=build /sysroot /
WORKDIR /root
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENTRYPOINT ["/usr/bin/bash"]

Thanks for looking.

mharwani commented 1 year ago

Hi, thank you for the feedback. I'm able to reproduce this on my machine. Build takes 6314s (1hr, 45m) with Finch and 66s with Docker. Usually, builds are not this slow, so this seems specific to the Dockerfile. Looking into the root cause.

dlaidlaw commented 1 year ago

In case you are wondering where the dnf command came from, see this AWS documentation: https://docs.aws.amazon.com/linux/al2023/ug/barebones-containers.html