-
Notifications
You must be signed in to change notification settings - Fork 53
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
59c6395
commit 9561b01
Showing
3 changed files
with
40 additions
and
17 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,29 @@ | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
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 Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: evilsocket/nerve: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,19 +1,12 @@ | ||
FROM lukemathwalker/cargo-chef:latest-rust-alpine as chef | ||
WORKDIR /app | ||
FROM rust:bullseye as builder | ||
|
||
FROM chef AS planner | ||
COPY ./Cargo.toml ./Cargo.lock ./ | ||
COPY ./src ./src | ||
RUN cargo chef prepare | ||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates cmake git | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json . | ||
RUN cargo chef cook --release | ||
COPY . . | ||
WORKDIR /app | ||
ADD . /app | ||
RUN cargo build --release | ||
RUN mv ./target/release/nerve ./nerve | ||
|
||
FROM scratch AS runtime | ||
WORKDIR /app | ||
COPY --from=builder /app/nerve /usr/local/bin/ | ||
ENTRYPOINT ["/usr/local/bin/nerve"] | ||
FROM debian:bullseye | ||
RUN apt-get update && apt-get install -y libssl-dev ca-certificates | ||
COPY --from=builder /app/target/release/nerve /usr/bin/nerve | ||
ENTRYPOINT ["/usr/bin/nerve"] |
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