Skip to content

Instantly share code, notes, and snippets.

@anoochit
Created June 16, 2020 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anoochit/40b248c8317199c071bbc1c638e40da2 to your computer and use it in GitHub Desktop.
Save anoochit/40b248c8317199c071bbc1c638e40da2 to your computer and use it in GitHub Desktop.
Dockerfile to build dart container in small image **ONLY** x86_64 arch
FROM google/dart AS dart-runtime
WORKDIR /app
ADD pubspec.* /app/
RUN pub get
ADD bin /app/bin/
RUN pub get --offline
RUN dart2native /app/bin/server.dart -o /app/server
FROM frolvlad/alpine-glibc
COPY --from=dart-runtime /app/server /server
CMD []
ENTRYPOINT ["/server"]
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment