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

docker: make container multi-platform #1136

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Docker Build and Push (Ubuntu & NVM variant)
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
target: final-ubuntu
file: docker/Dockerfile
pull: true
Expand All @@ -77,7 +77,7 @@ jobs:
uses: docker/build-push-action@v5
if: ${{ env.WORKFLOW_BUILD_DISTROLESS == true }}
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
target: final-distroless
file: docker/Dockerfile
pull: true
Expand Down
48 changes: 34 additions & 14 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
FROM ubuntu:focal AS builder-echidna
FROM alpine:3.18 AS builder-echidna
ENV LD_LIBRARY_PATH=/usr/local/lib PREFIX=/usr/local HOST_OS=Linux
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-suggests --no-install-recommends \
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk add --no-cache \
autoconf \
automake \
bash \
build-base \
bzip2-dev \
cabal \
cmake \
curl \
ghc \
git \
libbz2-dev \
libgmp-dev \
libreadline-dev \
libsecp256k1-dev \
libssl-dev \
software-properties-common \
sudo
RUN curl -sSL https://get.haskellstack.org/ | sh
COPY . /echidna/
gmp-dev \
libtool \
ncurses-static \
openssl-dev \
readline-dev \
stack@testing \
sudo \
zlib-dev \
zlib-static

WORKDIR /echidna
RUN .github/scripts/install-libff.sh
RUN stack upgrade && stack setup && stack install --flag echidna:static --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib

COPY .github/scripts /echidna/.github/scripts/
RUN .github/scripts/install-libsecp256k1.sh && \
.github/scripts/install-libff.sh

COPY . /echidna/
RUN mkdir -p /etc/stack &&\
{ cat /root/.stack/config.yaml ;\
echo "system-ghc: true" ;\
echo "install-ghc: false" ;\
echo "skip-ghc-check: true" ;\
} >> /etc/stack/config.yaml &&\
chmod 664 /etc/stack/config.yaml
RUN stack install --flag echidna:static --extra-include-dirs=/usr/local/include --extra-lib-dirs=/usr/local/lib


FROM ubuntu:focal AS builder-python3
Expand Down