-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (39 loc) · 1.65 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 2019 by the bsc docker image contributors
# SPDX-License-Identifier: GPL-3.0-only
#
# Author(s): Pavel Benacek <[email protected]>
FROM ubuntu:22.04
# Defeault argument values
ARG BJOBS=1
ARG USER=user
ARG UID=1000
ARG GID=1000
ARG PASS=password
ARG DOC=0
ARG GHC_VERSION="9.4.8"
ARG CABAL_VERSION="latest"
# Copy downloaded repos into image
COPY scripts/reps/bsc /bluespec/reps/bsc
COPY scripts/reps/bsc-contrib /bluespec/reps/bsc-contrib
COPY scripts/reps/bdw /bluespec/reps/bdw
COPY scripts/build-new-package.sh /bluespec
# Install tooling and editors
RUN apt update && apt upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt install -y tzdata sudo vim software-properties-common \
sudo xauth vim-gtk graphviz curl \
build-essential libffi-dev libffi8ubuntu1 libgmp-dev \
libgmp10 libncurses-dev libncurses5 libtinfo5
RUN add-apt-repository universe && apt update && apt upgrade -y
# Install GHC and its deps
RUN curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/local/bin/ghcup && \
chmod +x /usr/local/bin/ghcup
RUN ghcup -v install ghc --isolate /usr/local --force $GHC_VERSION && \
ghcup -v install cabal --isolate /usr/local/bin --force $CABAL_VERSION
RUN cabal update && cabal v1-install old-time regex-compat split syb
# Add user into the system
RUN groupadd --gid $GID $USER && \
useradd --uid $UID --gid $GID --groups sudo --shell /bin/bash -m $USER && \
echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/admins && \
echo "$USER:$PASS" | chpasswd
# Build Bluespec tools
RUN cd /bluespec && bash ./build-new-package.sh 1.0.0 1.0.0 1.0.0 $BJOBS $DOC