Skip to content

Commit

Permalink
build image for arm64 arch
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero committed Dec 10, 2021
1 parent e4f5067 commit dee7a0d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 34 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,32 @@ jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'

permissions:
contents: read
packages: write
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file ./$VERSION/Dockerfile --tag $IMAGE_NAME

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image
run: |
IMAGE_ID=ghcr.io/vulpemventures/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:latest
docker push $IMAGE_ID:latest
- name: Build image
run: >-
docker buildx build --push
--file ./$VERSION/Dockerfile
--tag ghcr.io/vulpemventures/$IMAGE_NAME:latest
--tag ghcr.io/vulpemventures/$IMAGE_NAME:$VERSION
--platform linux/arm64,linux/amd64 .
60 changes: 48 additions & 12 deletions 0.21.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,62 @@
FROM debian:stable-slim AS builder
FROM debian:stable-slim as builder

# VERSION of Elements Core to be build
# VERSION of BItcoin Core to be build
ARG VERSION=0.21.0

RUN apt-get update && apt-get install -y wget curl libzmq3-dev build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb-dev libdb++-dev libdb4.8
RUN apt-get update && apt-get install -y \
build-essential \
automake pkg-config \
wget curl libzmq3-dev \
libtool autotools-dev \
bsdmainutils python3 \
libsqlite3-dev libdb-dev \
libdb++-dev libevent-dev \
libboost-dev libboost-system-dev \
libboost-filesystem-dev libboost-test-dev

RUN wget -qO- https://github.com/ElementsProject/elements/archive/elements-$VERSION.tar.gz | tar -xvz -C /tmp
RUN wget -qO- https://github.com/ElementsProject/elements/archive/elements-$VERSION.tar.gz | tar -xvz

RUN cd /tmp/elements-elements-$VERSION/depends && make NO_QT=1 NO_UPNP=1 && cd .. && \
./autogen.sh && \
./configure --without-gui --with-incompatible-bdb && \
make && \
mv ./src/elementsd /elementsd && \
WORKDIR /elements-elements-$VERSION

RUN cd ./depends && make NO_QT=1 NO_UPNP=1 && cd .. && ./autogen.sh

RUN ./configure \
LDFLAGS=-static-libstdc++ \
CXXFLAGS="-O2" \
--disable-man \
--disable-shared \
--disable-ccache \
--disable-tests \
--enable-static \
--without-gui \
--without-libs \
--with-utils \
--with-zmq \
--with-sqlite=yes \
--without-miniupnpc \
--enable-reduce-exports \
--with-incompatible-bdb \
--enable-glibc-back-compat

RUN make clean
RUN make -j$(( $(nproc) + 1 )) check
RUN make install

RUN mv ./src/elementsd /elementsd && \
mv ./src/elements-cli /elements-cli

FROM debian:stable-slim

RUN apt-get update && apt-get install -y libboost-filesystem-dev \
RUN apt-get update && apt-get install -y \
libboost-system-dev \
libboost-filesystem-dev \
libboost-thread-dev \
libevent-dev \
libsodium-dev \
libzmq3-dev \
libdb-dev \
libdb++-dev
libdb++-dev \
libzmq3-dev \
libsqlite3-dev

RUN useradd -ms /bin/bash elements

Expand All @@ -35,3 +69,5 @@ COPY --from=builder /elements-cli /usr/local/bin/elements-cli
RUN mkdir -p "$HOME/.elements/"

ENTRYPOINT [ "elementsd" ]


0 comments on commit dee7a0d

Please sign in to comment.