Skip to content

Commit

Permalink
Rename workflow file and add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilKWarmdahl committed Nov 1, 2024
1 parent 63be887 commit 3f5cd42
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
release-base-image:
# if: ${{ startsWith(github.ref_name, '${{env.SERVICE_NAME}}') }}
uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@ekw/workflow-templates
uses: concordium/.github/.github/workflows/docker-release-workflow.yaml@main
with:
SERVICE_NAME: "static-libraries"
BUILD_ARGS: |
Expand Down
58 changes: 58 additions & 0 deletions docker/static-libraries.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
ARG rust_version
ARG ghc_version
ARG stack_version
ARG protoc_version
ARG ubuntu_version

FROM ubuntu:$ubuntu_version

ENV RUST_VERSION=$rust_version
ENV GHC_VERSION=$ghc_version
ENV STACK_VERSION=$stack_version
ENV PROTOC_VERSION=$protoc_version

ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="${PATH}:/root/.cargo/bin:/root/.stack/bin"

RUN set -eux && \
apt-get update && \
apt-get -y upgrade && \
apt-get -y install \
curl \
git \
g++ \
liblmdb-dev \
libpq-dev \
libgmp-dev \
libz-dev \
libssl-dev \
make \
pkgconf \
unzip \
&& rm -rf /var/lib/apt/lists/*

# Install protoc by version specified in environment.
RUN curl -L https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip -o protoc.zip; \
unzip protoc.zip bin/protoc -d /usr/; \
rm protoc.zip

RUN curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain ${rust_version} -y; \
# install fPIC GHC@$ghc_version
curl https://s3-eu-west-1.amazonaws.com/static-libraries.concordium.com/ghc-${ghc_version}-fpic-gmp-x86_64-unknown-linux-gnu.tar.gz -o ghc.tar.gz; \
tar -xf ghc.tar.gz; \
cp -r bootstrapped_out/* /; \
rm -r bootstrapped_out ghc.tar.gz; \
# install stack@$stack_version
curl -L https://github.com/commercialhaskell/stack/releases/download/v${stack_version}/stack-${stack_version}-linux-x86_64.tar.gz -o stack.tar.gz; \
tar -xf stack.tar.gz; \
mkdir -p $HOME/.stack/bin;\
mv stack-${stack_version}-linux-x86_64/stack $HOME/.stack/bin; \
echo "system-ghc: true" > ~/.stack/config.yaml; \
rm -rf stack.tar.gz; \
stack update; \
# check
cargo --version; \
rustup --version; \
rustc --version; \
ghc --version; \
stack --version;

0 comments on commit 3f5cd42

Please sign in to comment.