Skip to content

Commit

Permalink
Update docker build process
Browse files Browse the repository at this point in the history
Updated build process to automatically build and push images to docker hub
Versions are grouped by folders
Using personal modification of magi source code for now, due to an updated bdb installation
  • Loading branch information
aaronmee committed May 4, 2024
1 parent 9b458ff commit 5aa95e0
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy Docker Image

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-22.04
env:
MAGI_VERSION: '1.4.7.2'
USERNAME: 'aaronme'
IMAGE_NAME: 'magi-docker'
steps:
- name: Checkout Repository
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

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ env.USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
file: ${{ env.MAGI_VERSION }}-pre/Dockerfile
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest,${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:v${{ env.MAGI_VERSION }}
11 changes: 6 additions & 5 deletions Dockerfile → 1.4.7.2-pre/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ WORKDIR /magi

# Update and install required packages
RUN apt-get update && apt-get install -y --no-install-recommends \
git build-essential libssl-dev libgmp-dev libminiupnpc-dev libdb-dev libdb5.3++-dev zlib1g-dev \
git curl build-essential libssl-dev libgmp-dev libminiupnpc-dev zlib1g-dev ca-certificates \
libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libboost-chrono-dev

# Compile the wallet (for some reason, there's an error with leveldb, so two files are generated manually)
RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/aaronmee/magi.git \
# Compile the binary
RUN git clone https://github.com/aaronmee/magi.git \
&& cd magi/src/leveldb \
&& make clean \
&& make libleveldb.a libmemenv.a \
&& cd .. \
&& make -j $(nproc) -f makefile.unix xCPUARCH=$(uname -m) STATIC=all CXXFLAGS="-s -static -static-libgcc -static-libstdc++" \
&& ../contrib/bdb/install_db4.8.sh \
&& make -j $(nproc) -f makefile.unix xCPUARCH=$(uname -m) STATIC=all CXXFLAGS="-s -static" \
&& cp magid /magi


# ALpine as container image
# Alpine as container image
FROM alpine:latest as container

# Set working directory
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml → 1.4.7.2-pre/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
services:
magi:
magi-docker:
image: aaronme/magi-docker:latest
container_name: magi-docker
ports:
- "8232:8232"
- "8233:8233"
volumes:
- ./data:/magi/data
# restart: unless-stopped
restart: unless-stopped

0 comments on commit 5aa95e0

Please sign in to comment.