-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6a9436
commit 778dae7
Showing
2 changed files
with
42 additions
and
13 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,30 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
FROM rust:latest | ||
|
||
RUN apt update && apt upgrade -y | ||
RUN apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross | ||
|
||
RUN rustup target add aarch64-unknown-linux-gnu | ||
RUN rustup toolchain install stable-aarch64-unknown-linux-gnu | ||
|
||
WORKDIR /app | ||
|
||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ | ||
|
||
# Dockerfile | ||
FROM rust:latest | ||
|
||
WORKDIR /app | ||
|
||
# Copy the source code into the container | ||
COPY . . | ||
CMD ["cargo", "build", "--target", "aarch64-unknown-linux-gnu"] | ||
|
||
# Build the Rust application | ||
RUN cargo build --release | ||
|
||
# Set the entry point for the application | ||
CMD ["./target/release/scanner"] |