Browse Source

Provide dockerfile and build during release

Dockerfile are generally useful but are especially needed in our case because we depend on a glibc2.29 which is not available on older distros
refactor/no-log-handler
Philipp Hoenisch 3 years ago
parent
commit
d416c6962a
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 3
      .dockerignore
  2. 36
      .github/workflows/build-release-binary.yml
  3. 15
      Dockerfile

3
.dockerignore

@ -0,0 +1,3 @@
.*
!./target

36
.github/workflows/build-release-binary.yml

@ -14,42 +14,52 @@ jobs:
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/amd64
- bin: taker
target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/arm/v7
- bin: taker
target: aarch64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/arm64
- bin: taker
target: x86_64-apple-darwin
os: macos-latest
archive_ext: tar
docker_platforms: None
- bin: taker
target: x86_64-pc-windows-msvc
os: windows-latest
archive_ext: zip
docker_platforms: None
- bin: maker
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/amd64
- bin: maker
target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/arm64
- bin: maker
target: aarch64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
docker_platforms: linux/arm64
- bin: maker
target: x86_64-apple-darwin
os: macos-latest
archive_ext: tar
docker_platforms: None
- bin: maker
target: x86_64-pc-windows-msvc
os: windows-latest
archive_ext: zip
docker_platforms: None
runs-on: ${{ matrix.os }}
steps:
- name: Checkout tagged commit
@ -144,3 +154,29 @@ jobs:
asset_path: ./${{ steps.create-archive-name.outputs.archive }}
asset_name: ${{ steps.create-archive-name.outputs.archive }}
asset_content_type: application/gzip
- name: Set up QEMU
if: matrix.os != 'windows-latest' && matrix.os != 'macos-latest'
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
if: matrix.os != 'windows-latest' && matrix.os != 'macos-latest'
uses: docker/setup-buildx-action@v1
- name: Login into github registry
uses: docker/login-action@v1.10.0
if: matrix.os != 'windows-latest' && matrix.os != 'macos-latest'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish docker image
if: matrix.os != 'windows-latest' && matrix.os != 'macos-latest'
run: |
docker buildx build \
--push \
--platform=${{ matrix.docker_platforms }} \
--tag ghcr.io/${{ github.actor }}/hermes-${{ matrix.bin }}-${{ matrix.target }} \
--build-arg BINARY_PATH=target/${{ matrix.target }}/release/${{ matrix.bin }} \
.

15
Dockerfile

@ -0,0 +1,15 @@
FROM debian:bullseye-slim
ARG BINARY_PATH
RUN echo "Copying $BINARY_PATH into container"
COPY $BINARY_PATH hermes
RUN chmod a+x hermes
VOLUME data
# HTTP Port and P2P Port
EXPOSE 8000 9999
ENTRYPOINT ["/hermes", "--data-dir=/data", "--http-address=0.0.0.0:8000"]
Loading…
Cancel
Save