Skip to content

Commit dee7a0d

Browse files
committed
build image for arm64 arch
1 parent e4f5067 commit dee7a0d

File tree

2 files changed

+66
-34
lines changed

2 files changed

+66
-34
lines changed

.github/workflows/docker-publish.yml

+18-22
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,32 @@ jobs:
1717
push:
1818
runs-on: ubuntu-latest
1919
if: github.event_name == 'push'
20-
21-
permissions:
22-
contents: read
23-
packages: write
20+
env:
21+
DOCKER_CLI_EXPERIMENTAL: "enabled"
2422

2523
steps:
2624
- uses: actions/checkout@v2
27-
28-
- name: Build image
29-
run: docker build . --file ./$VERSION/Dockerfile --tag $IMAGE_NAME
3025

26+
- name: Set up QEMU
27+
uses: docker/setup-qemu-action@v1
28+
29+
- name: Set up Docker Buildx
30+
id: buildx
31+
uses: docker/setup-buildx-action@v1
32+
with:
33+
install: true
3134

3235
- name: Login to GitHub Container Registry
3336
uses: docker/login-action@v1
3437
with:
3538
registry: ghcr.io
36-
username: ${{ github.actor }}
39+
username: ${{ github.repository_owner }}
3740
password: ${{ secrets.GITHUB_TOKEN }}
3841

39-
- name: Push image
40-
run: |
41-
IMAGE_ID=ghcr.io/vulpemventures/$IMAGE_NAME
42-
43-
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
44-
45-
echo IMAGE_ID=$IMAGE_ID
46-
echo VERSION=$VERSION
47-
48-
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
49-
docker push $IMAGE_ID:$VERSION
50-
51-
docker tag $IMAGE_NAME $IMAGE_ID:latest
52-
docker push $IMAGE_ID:latest
42+
- name: Build image
43+
run: >-
44+
docker buildx build --push
45+
--file ./$VERSION/Dockerfile
46+
--tag ghcr.io/vulpemventures/$IMAGE_NAME:latest
47+
--tag ghcr.io/vulpemventures/$IMAGE_NAME:$VERSION
48+
--platform linux/arm64,linux/amd64 .

0.21.0/Dockerfile

+48-12
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,62 @@
1-
FROM debian:stable-slim AS builder
1+
FROM debian:stable-slim as builder
22

3-
# VERSION of Elements Core to be build
3+
# VERSION of BItcoin Core to be build
44
ARG VERSION=0.21.0
55

6-
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
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
automake pkg-config \
9+
wget curl libzmq3-dev \
10+
libtool autotools-dev \
11+
bsdmainutils python3 \
12+
libsqlite3-dev libdb-dev \
13+
libdb++-dev libevent-dev \
14+
libboost-dev libboost-system-dev \
15+
libboost-filesystem-dev libboost-test-dev
716

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

10-
RUN cd /tmp/elements-elements-$VERSION/depends && make NO_QT=1 NO_UPNP=1 && cd .. && \
11-
./autogen.sh && \
12-
./configure --without-gui --with-incompatible-bdb && \
13-
make && \
14-
mv ./src/elementsd /elementsd && \
19+
WORKDIR /elements-elements-$VERSION
20+
21+
RUN cd ./depends && make NO_QT=1 NO_UPNP=1 && cd .. && ./autogen.sh
22+
23+
RUN ./configure \
24+
LDFLAGS=-static-libstdc++ \
25+
CXXFLAGS="-O2" \
26+
--disable-man \
27+
--disable-shared \
28+
--disable-ccache \
29+
--disable-tests \
30+
--enable-static \
31+
--without-gui \
32+
--without-libs \
33+
--with-utils \
34+
--with-zmq \
35+
--with-sqlite=yes \
36+
--without-miniupnpc \
37+
--enable-reduce-exports \
38+
--with-incompatible-bdb \
39+
--enable-glibc-back-compat
40+
41+
RUN make clean
42+
RUN make -j$(( $(nproc) + 1 )) check
43+
RUN make install
44+
45+
RUN mv ./src/elementsd /elementsd && \
1546
mv ./src/elements-cli /elements-cli
1647

1748
FROM debian:stable-slim
1849

19-
RUN apt-get update && apt-get install -y libboost-filesystem-dev \
50+
RUN apt-get update && apt-get install -y \
51+
libboost-system-dev \
52+
libboost-filesystem-dev \
2053
libboost-thread-dev \
2154
libevent-dev \
2255
libsodium-dev \
23-
libzmq3-dev \
2456
libdb-dev \
25-
libdb++-dev
57+
libdb++-dev \
58+
libzmq3-dev \
59+
libsqlite3-dev
2660

2761
RUN useradd -ms /bin/bash elements
2862

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

3771
ENTRYPOINT [ "elementsd" ]
72+
73+

0 commit comments

Comments
 (0)