-
-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CI build for ARM64 Docker image
Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
- Loading branch information
Showing
3 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Docker ARM64 | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
docker: | ||
# Don't change this name - it is used by the merge protection rules | ||
name: Build and test docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
# https://github.com/docker/metadata-action | ||
- name: Docker meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/maplibre/martin | ||
|
||
# https://github.com/docker/setup-qemu-action | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2.1.0 | ||
|
||
# https://github.com/docker/setup-buildx-action | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2.5.0 | ||
with: | ||
install: true | ||
platforms: linux/arm64 | ||
|
||
- name: Build the Docker image | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
file: arm64.Dockerfile | ||
push: false | ||
load: true | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
platforms: linux/arm64 | ||
|
||
- name: Login to GitHub Docker registry | ||
uses: docker/login-action@v2 | ||
if: ${{ github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push the Docker image | ||
if: ${{ github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' }} | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM rust:1.68-bullseye as builder | ||
|
||
WORKDIR /usr/src/martin | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
libssl-dev \ | ||
perl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY . . | ||
RUN CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse cargo build --release --features=vendored-openssl | ||
|
||
|
||
FROM debian:bullseye-slim | ||
|
||
LABEL org.opencontainers.image.description="Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support" | ||
|
||
COPY --from=builder \ | ||
/usr/src/martin/target/release/martin \ | ||
/usr/local/bin/ | ||
|
||
EXPOSE 3000 | ||
ENTRYPOINT ["/usr/local/bin/martin"] |