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

Add Dockerfile #9

Merged
merged 1 commit into from
May 10, 2024
Merged
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
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
copilot-profiling
.DS_Store
.log

Dockerfile
.git
.gitignore
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:focal

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --yes curl gcc g++ git libz-dev make libgmp3-dev libtcl8.6 libtinfo-dev wget

ENV BSC_VER=2023.07
RUN mkdir -p /root/bsc
RUN wget https://github.com/B-Lang-org/bsc/releases/download/$BSC_VER/bsc-$BSC_VER-ubuntu-20.04.tar.gz -O /root/bsc.tar.gz && \
tar -xvf /root/bsc.tar.gz -C /root/bsc --strip-components=1 && \
rm /root/bsc.tar.gz

ENV GHCUP_VER=0.1.22.0
RUN mkdir -p /root/.ghcup/bin
RUN wget https://downloads.haskell.org/~ghcup/$GHCUP_VER/x86_64-linux-ghcup-$GHCUP_VER -O /root/.ghcup/bin/ghcup && \
chmod a+x /root/.ghcup/bin/ghcup

ENV PATH=/root/bsc/bin:/root/.cabal/bin:/root/.ghcup/bin:$PATH

ENV GHC_VER=9.2.8
ENV CABAL_VER=3.8.1.0
RUN ghcup install ghc $GHC_VER && \
ghcup set ghc $GHC_VER && \
ghcup install cabal $CABAL_VER && \
ghcup set cabal $CABAL_VER && \
cabal update

COPY . /copilot-bluespec
WORKDIR /copilot-bluespec

RUN cabal configure --enable-tests && \
cabal build --write-ghc-environment-files=always && \
cabal install --lib copilot . --package-env . && \
cabal test

ENTRYPOINT ["/usr/bin/bash"]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ The generated Bluespec code requires `bsc` (the Bluespec compiler) in order to
be compiled. `bsc` can be downloaded
[here](https://github.com/B-Lang-org/bsc/releases).

We also provide a [Dockerfile](Dockerfile) which automates the process of
installing Copilot, Copilot-Bluespec, and `bsc`. The Dockerfile can be built and
run using the following commands:

```
$ docker build -t <tag> .
$ docker run -it <tag>
```

Where `<tag>` is a unique name for the Docker image.

## Further information
For further information, install instructions and documentation, please visit
the Copilot website:
Expand Down
Loading