Skip to content

Commit

Permalink
Fix Dockerfile, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
vidsinghal committed Aug 25, 2023
1 parent 2bc1800 commit 74f702e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 7 deletions.
47 changes: 47 additions & 0 deletions .artifact/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Ubuntu 22
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
ENV USERNAME=root


# install dependencies
RUN apt-get update && \
apt-get -y install --no-install-recommends software-properties-common && \
apt-get -y install --no-install-recommends \
libgc-dev \
libgmp-dev \
build-essential \
uthash-dev \
vim \
wget \
curl

RUN wget --no-check-certificate https://mirror.racket-lang.org/installers/7.5/racket-7.5-x86_64-linux.sh
RUN chmod +x racket-7.5-x86_64-linux.sh
RUN ./racket-7.5-x86_64-linux.sh


# update path
USER ${USERNAME}
WORKDIR /${USERNAME}
ENV PATH="/${USERNAME}/.local/bin:/${USERNAME}/.cabal/bin:/${USERNAME}/.ghcup/bin:$PATH"
RUN echo "export PATH=${PATH}" >> /${USERNAME}/.profile

#install ghcup
RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.4.6 BOOTSTRAP_HASKELL_CABAL_VERSION=3.8.1.0 BOOTSTRAP_HASKELL_INSTALL_STACK=1 BOOTSTRAP_HASKELL_INSTALL_HLS=1 BOOTSTRAP_HASKELL_ADJUST_BASHRC=P sh

# update cabal package list
RUN cabal update

ARG RUST=1.71.0

# install rustup, rustc, and cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=${RUST}

RUN . "$HOME/.cargo/env"

ADD . /gibbon

RUN rm /gibbon/gibbon-rts/build/gibbon_rts.h

CMD ["bash"]
2 changes: 0 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,4 @@ ARG RUST=1.71.0
# install rustup, rustc, and cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=${RUST} -y

ADD . /home/${USERNAME}/gibbon

CMD ["bash"]
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,37 @@ If you'd like to run the testsuite, you can do so with:
$ cd $GIBBONDIR && ./run_all_tests.sh


## Building Gibbon using Docker
## Building a Developement docker container for Gibbon

To build the Dockerfile run the command below from the gibbon directory.
To build the Dockerfile for dev purposes run the command below from the gibbon directory.

```
DOCKER_BUILDKIT=1 docker image build -t gibbon -f .devcontainer/Dockerfile .
```
Run the docker image using the following command.

```
docker run --user=root -t -i gibbon
docker run -t -i gibbon
```

Follow the previous instructions to build gibbon in the docker container.
There should be a gibbon directory in ~/ in the docker.
This image does not pre-populate the gibbon folder. Use git clone to clone gibbon into a folder.
Use instructions from before to build gibbon.

## Building a Artifact version of Gibbon with the gibbon source code pre-populated

To build a image with the gibbon source code already in the image run

```
DOCKER_BUILDKIT=1 docker image build -t gibbon -f .artifact/Dockerfile .
```

Run the container with

```
docker run -t -i gibbon
```

This has the gibbon source code avaiable in /gibbon

## Using Gibbon

Expand Down

0 comments on commit 74f702e

Please sign in to comment.