Skip to content

Commit

Permalink
Build docker container
Browse files Browse the repository at this point in the history
Builds a Debian Bookworm (slim) docker container with Admarus pre-built inside it, and the OpenSSL dynamic libraries.

Run with:

```sh
docker run --network=host ghcr.io/Mubelotix/admarus:master \
  --ipfs-rpc=http://host.docker.internal:5001 \
  --external-addrs=/ip4/$(curl -s https://api.ipify.org)/tcp/4002 \
  --external-addrs=/ip6/$(curl -s https://api64.ipify.org)/tcp/4002 \
```

fixes #97
  • Loading branch information
jphastings authored and Mubelotix committed Jun 1, 2024
1 parent f6156b2 commit 25f8732
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish container

on:
push:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM rust:1-slim-bookworm as build

RUN apt-get update && apt-get install -y pkg-config libssl-dev && apt-get clean

WORKDIR /usr/src/admarus
COPY . .

RUN cd daemon && \
cargo build --release && \
mv ../target/release/admarusd /usr/local/bin/admarusd && \
cd ../../ && \
rm -rf admarus

FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y libssl ca-certificates && apt-get clean

COPY --from=build /usr/local/bin/admarusd /usr/local/bin/admarusd

EXPOSE 4002
EXPOSE 5002

ENTRYPOINT ["/usr/local/bin/admarusd"]

0 comments on commit 25f8732

Please sign in to comment.