-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
I have a long-running server that has code that runs slow when compiled AOT, and I want to optimize startup time and reduce the image size. I've tried doing the following:
FROM dart:2.17 AS build
WORKDIR /app
COPY pubspec.yaml .
RUN dart pub get
COPY . .
RUN dart pub get --offline
RUN dart compile jit-snapshot bin/server.dart
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server.jit app/bin/
EXPOSE 4002
ENTRYPOINT ["dart", "/app/bin/server.jit"]
However, I get an error when I try to run the container, because dart
is not found. Is there any way this could work, similar to AOT?
Using something like this
FROM dart:2.17
WORKDIR /app
COPY bin/server.jit /app/bin/
ENTRYPOINT ["dart", "bin/server.jit"]
results in a 266.8MB
image(!)
Metadata
Metadata
Assignees
Labels
No labels