Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature:Autograding] Add Haskell image #52

Merged
merged 19 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions dockerfiles/haskell/8.8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# First Stage: Builder
FROM debian:buster-slim AS builder

# Install necessary dependencies for building GHC
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl build-essential libffi-dev libgmp-dev libtinfo5 ca-certificates xz-utils \
&& rm -rf /var/lib/apt/lists/*

# Install GHCup (Haskell toolchain manager) without automatically installing the latest GHC
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | bash -s -- -y --no-ghc \
&& /root/.ghcup/bin/ghcup install ghc 8.10.7 \
&& /root/.ghcup/bin/ghcup set ghc 8.10.7 \
&& rm -rf /root/.ghcup/ghc/9.4.8

# Clean up unnecessary build artifacts and cache
RUN rm -rf /root/.ghcup/cache /var/lib/apt/lists/*


# Second Stage: Final Image
ION606 marked this conversation as resolved.
Show resolved Hide resolved
FROM debian:buster-slim
ION606 marked this conversation as resolved.
Show resolved Hide resolved

# Install runtime dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libffi6 libgmp10 libtinfo5 build-essential \
&& rm -rf /var/lib/apt/lists/*

# Copy GHC from the builder stage
COPY --from=builder /root/.ghcup /root/.ghcup

# Set PATH to include GHCup
ENV PATH="/root/.ghcup/bin:${PATH}"

# Set the working directory
WORKDIR /usr/src/app

# Install libgmp-dev explicitly for runtime linking
RUN apt-get update \
&& apt-get install -y --no-install-recommends libgmp-dev \
&& rm -rf /var/lib/apt/lists/*

# Default command to keep the container running
CMD ["/bin/bash"]
3 changes: 3 additions & 0 deletions dockerfiles/haskell/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pushLatest": false
}
Loading