Skip to content

Create a docker image with the minimal requirements to run the tutorial #2319

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use the official Ubuntu base image
FROM ubuntu:latest
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Pin to a ubuntu version. The package names and versions might change, leading to a flaky docker image.


# Update package lists and install necessary packages
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y build-essential libffi-dev libgmp-dev libtinfo6 libtinfo-dev python3 openjdk-11-jdk && \
apt-get install -y nix-bin && \
apt-get install -y graphviz xdot
Comment on lines +7 to +9
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: change this to use a single line per dependency, this will enable modifying just a single package name instead the whole line.


# Install bazelisk to handle a different bazel version
RUN apt install -y npm && \
npm install -g @bazel/bazelisk
Comment on lines +12 to +13
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: pin the bazelisk to a particular version, to ensure a reproducible build.


# Set the working directory inside the container
WORKDIR /home/rules_haskell

# Copy application files (if any)
COPY . /home/rules_haskell

# Run bazel using bazelisk to ensure the correct version is been used
RUN bazelisk --version

# Build tutorial
RUN cd tutorial && bazelisk build //...
1 change: 1 addition & 0 deletions tutorial/.bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.5.0