-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
4e36301
commit c486144
Showing
4 changed files
with
114 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,44 @@ | ||
name: Docker Publish | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_call: | ||
workflow_dispatch: | ||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_TOKEN }} | ||
- name: Build and push observer_ward | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
target: observer_ward | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/observer_ward:latest | ||
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/observer_ward:latest | ||
cache-to: type=inline | ||
- name: Build and push observer_ward | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
target: observer_ward_with_nuclei | ||
push: true | ||
tags: ${{ secrets.DOCKER_USERNAME }}/observer_ward:with_nuclei | ||
cache-from: type=registry,ref=${{ secrets.DOCKER_USERNAME }}/observer_ward:with_nuclei | ||
cache-to: type=inline |
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,28 @@ | ||
FROM rust:latest AS builder | ||
|
||
WORKDIR /app | ||
#为了命中docker构建缓存,先拷贝这几个文件进去 | ||
RUN apt-get update &&\ | ||
apt-get install -y --no-install-recommends gcc-multilib xz-utils liblz4-tool libc6-dev libssl-dev pkg-config musl-tools patchelf build-essential zlib1g-dev ca-certificates | ||
COPY .cargo .cargo | ||
COPY observer_ward/Cargo.toml Cargo.toml | ||
COPY engine/ /engine | ||
RUN cargo fetch | ||
COPY observer_ward/src src | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN cargo build --release --target=x86_64-unknown-linux-musl | ||
|
||
# Use any runner as you want | ||
# But beware that some images have old glibc which makes rust unhappy | ||
FROM alpine:latest AS observer_ward | ||
ENV TZ=Asia/Shanghai | ||
RUN apk -U upgrade --no-cache \ | ||
&& apk add --no-cache bind-tools ca-certificates | ||
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/observer_ward /usr/local/bin/ | ||
ARG SKIP_COPY=false | ||
ADD "https://0x727.github.io/FingerprintHub/web_fingerprint_v4.json" web_fingerprint_v4.json | ||
RUN observer_ward --update-plugin | ||
ENTRYPOINT [ "observer_ward" ] | ||
#docker build --target observer_ward_with_nuclei -t "observer_ward:dev" . -f Dockerfile | ||
FROM observer_ward AS observer_ward_with_nuclei | ||
COPY --from=projectdiscovery/nuclei:latest /usr/local/bin/nuclei /usr/local/bin/ |
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