Skip to content

Instantly share code, notes, and snippets.

@pgeraghty
Created March 16, 2020 17:53
Show Gist options
  • Save pgeraghty/feccf5ff86b54b7512735943dc7af4a9 to your computer and use it in GitHub Desktop.
Save pgeraghty/feccf5ff86b54b7512735943dc7af4a9 to your computer and use it in GitHub Desktop.
Basic Dockerfile for multi-stage build of statically-linked binary via Crystal shards
FROM crystallang/crystal:0.33.0-alpine-build as builder
WORKDIR /app
COPY . /app
RUN shards build --static --release --no-debug
FROM scratch
WORKDIR /app
COPY --from=builder /app/bin /bin
ENTRYPOINT ["/bin/<YOUR_BINARY_NAME"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment