Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Minimalistic Docker image from a simple Dart application - includes only the AOT-compiled app and dartaotruntime.
FROM google/dart AS dartc
ADD pubspec.* /app/
RUN pub get
ADD bin/ /app/bin/
ADD lib/ /app/lib/
RUN pub get --offline
RUN dart2aot /app/bin/main.dart /app/main.aot
FROM bitnami/minideb
COPY --from=dartc /app/main.aot /main.aot
COPY --from=dartc /usr/lib/dart/bin/dartaotruntime /dartaotruntime
CMD []
ENTRYPOINT ["/dartaotruntime", "/main.aot"]
Copy link

herloct commented Sep 28, 2019

Can we use alpine as base image?

Copy link

renatoathaydes commented Oct 1, 2019

Most likely yes, try it to be sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment