From 8843b894e22044a0e3d16b57abbad6f4fa8f8a42 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 22 Jan 2023 21:50:50 -0700 Subject: [PATCH 1/3] Add gerbil builder container --- .../cerc-builder-gerbil/Dockerfile | 17 +++++++++++++++++ .../cerc-builder-gerbil/README.md | 6 ++++++ .../cerc-builder-gerbil/entrypoint.sh | 2 ++ .../cerc-builder-gerbil/install-dependencies.sh | 15 +++++++++++++++ app/data/container-image-list.txt | 1 + 5 files changed, 41 insertions(+) create mode 100644 app/data/container-build/cerc-builder-gerbil/Dockerfile create mode 100644 app/data/container-build/cerc-builder-gerbil/README.md create mode 100755 app/data/container-build/cerc-builder-gerbil/entrypoint.sh create mode 100755 app/data/container-build/cerc-builder-gerbil/install-dependencies.sh diff --git a/app/data/container-build/cerc-builder-gerbil/Dockerfile b/app/data/container-build/cerc-builder-gerbil/Dockerfile new file mode 100644 index 00000000..af077286 --- /dev/null +++ b/app/data/container-build/cerc-builder-gerbil/Dockerfile @@ -0,0 +1,17 @@ +# From: https://github.com/vyzo/gerbil/blob/master/docker/Dockerfile +FROM gerbil/ubuntu + +# Install the Solidity compiler (latest stable version) +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" \ + apt-get install -y software-properties-common && \ + add-apt-repository ppa:ethereum/ethereum && \ + apt-get update && apt-get install -y solc && \ + RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN mkdir /scripts +COPY install-dependencies.sh /scripts + +RUN bash /scripts/install-dependencies.sh + +COPY entrypoint.sh . +ENTRYPOINT ["./entrypoint.sh"] diff --git a/app/data/container-build/cerc-builder-gerbil/README.md b/app/data/container-build/cerc-builder-gerbil/README.md new file mode 100644 index 00000000..f5cbe601 --- /dev/null +++ b/app/data/container-build/cerc-builder-gerbil/README.md @@ -0,0 +1,6 @@ +## Gerbil Scheme Builder + +This container is designed to be used as a simple "build runner" environment for building and running Scheme projects +using Gerbil and gerbil-ethereum. + + diff --git a/app/data/container-build/cerc-builder-gerbil/entrypoint.sh b/app/data/container-build/cerc-builder-gerbil/entrypoint.sh new file mode 100755 index 00000000..311cb8cb --- /dev/null +++ b/app/data/container-build/cerc-builder-gerbil/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec "$@" diff --git a/app/data/container-build/cerc-builder-gerbil/install-dependencies.sh b/app/data/container-build/cerc-builder-gerbil/install-dependencies.sh new file mode 100755 index 00000000..c6725ef8 --- /dev/null +++ b/app/data/container-build/cerc-builder-gerbil/install-dependencies.sh @@ -0,0 +1,15 @@ +DEPS=(github.com/fare/gerbil-utils + github.com/fare/gerbil-poo + github.com/fare/gerbil-crypto + github.com/fare/gerbil-persist + github.com/fare/gerbil-ethereum + github.com/drewc/gerbil-swank + github.com/drewc/drewc-r7rs-swank + github.com/drewc/smug-gerbil + github.com/drewc/ftw + github.com/vyzo/gerbil-libp2p + ) ; +for i in ${DEPS[@]} ; do + gxpkg install $i && + gxpkg build $i +done diff --git a/app/data/container-image-list.txt b/app/data/container-image-list.txt index 48d5bc04..7e5a0191 100644 --- a/app/data/container-image-list.txt +++ b/app/data/container-image-list.txt @@ -22,3 +22,4 @@ cerc/eth-probe cerc/builder-js cerc/keycloak cerc/tx-spammer +cerc/builder-gerbil From 46bcc2f882ffc5dc4e685f22ccaca0b23b83738d Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 22 Jan 2023 22:12:05 -0700 Subject: [PATCH 2/3] Fix bugs --- .../container-build/cerc-builder-gerbil/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/data/container-build/cerc-builder-gerbil/Dockerfile b/app/data/container-build/cerc-builder-gerbil/Dockerfile index af077286..3daf6003 100644 --- a/app/data/container-build/cerc-builder-gerbil/Dockerfile +++ b/app/data/container-build/cerc-builder-gerbil/Dockerfile @@ -2,16 +2,19 @@ FROM gerbil/ubuntu # Install the Solidity compiler (latest stable version) -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" \ +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" && \ apt-get install -y software-properties-common && \ add-apt-repository ppa:ethereum/ethereum && \ apt-get update && apt-get install -y solc && \ - RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mkdir /scripts COPY install-dependencies.sh /scripts RUN bash /scripts/install-dependencies.sh -COPY entrypoint.sh . -ENTRYPOINT ["./entrypoint.sh"] +# Needed to prevent git from raging about /src +RUN git config --global --add safe.directory /src + +COPY entrypoint.sh /scripts +ENTRYPOINT ["/scripts/entrypoint.sh"] From 4ab84eb7ca23786db42f0eb471a4db6be8e1da22 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Mon, 23 Jan 2023 07:24:27 -0700 Subject: [PATCH 3/3] Enhance readme --- .../cerc-builder-gerbil/README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/data/container-build/cerc-builder-gerbil/README.md b/app/data/container-build/cerc-builder-gerbil/README.md index f5cbe601..854139b9 100644 --- a/app/data/container-build/cerc-builder-gerbil/README.md +++ b/app/data/container-build/cerc-builder-gerbil/README.md @@ -1,6 +1,21 @@ ## Gerbil Scheme Builder -This container is designed to be used as a simple "build runner" environment for building and running Scheme projects -using Gerbil and gerbil-ethereum. +This container is designed to be used as a simple "build runner" environment for building and running Scheme projects using Gerbil and gerbil-ethereum. Its primary purpose is to allow build/test/run of gerbil code without the need to install and configure all the necessary prerequisites and dependencies on the host system. +### Usage + +First build the container with: + +``` +$ laconic-so build-containers --include cerc/builder-gerbil +``` + +Now, assuming a gerbil project located at `~/projects/my-project`, run bash in the container mounting the project with: + +``` +$ docker run -it -v $HOME/projects/my-project:/src cerc/builder-gerbil:latest bash +root@7c4124bb09e3:/src# +``` + +Now gerbil commands can be run.