mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:15:25 +00:00
build: update Docker workflow & build process (#6094)
* ci: runners to use ubuntu-latest Signed-off-by: Dwi Siswanto <git@dw1.io> * build: update Docker workflow & build process Signed-off-by: Dwi Siswanto <git@dw1.io> --------- Signed-off-by: Dwi Siswanto <git@dw1.io>
This commit is contained in:
parent
46c05d2f35
commit
01e5cae509
47
.github/workflows/dockerhub-push.yml
vendored
47
.github/workflows/dockerhub-push.yml
vendored
@ -1,47 +0,0 @@
|
|||||||
name: 🐳 Docker Push
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: ["🎉 Release Binary"]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest-16-cores
|
|
||||||
steps:
|
|
||||||
- name: Git Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Get GitHub tag
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
curl --silent "https://api.github.com/repos/projectdiscovery/nuclei/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: projectdiscovery/nuclei:latest,projectdiscovery/nuclei:${{ steps.meta.outputs.TAG }}
|
|
||||||
|
|
||||||
- name: Update DockerHub Description
|
|
||||||
uses: peter-evans/dockerhub-description@v4
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
|
||||||
repository: projectdiscovery/nuclei
|
|
||||||
2
.github/workflows/generate-pgo.yaml
vendored
2
.github/workflows/generate-pgo.yaml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
targets: [150]
|
targets: [150]
|
||||||
runs-on: ubuntu-latest-16-cores
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'projectdiscovery/nuclei'
|
if: github.repository == 'projectdiscovery/nuclei'
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|||||||
2
.github/workflows/perf-regression.yaml
vendored
2
.github/workflows/perf-regression.yaml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
perf-regression:
|
perf-regression:
|
||||||
runs-on: ubuntu-latest-16-cores
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'projectdiscovery/nuclei'
|
if: github.repository == 'projectdiscovery/nuclei'
|
||||||
env:
|
env:
|
||||||
BENCH_OUT: "/tmp/bench.out"
|
BENCH_OUT: "/tmp/bench.out"
|
||||||
|
|||||||
2
.github/workflows/perf-test.yaml
vendored
2
.github/workflows/perf-test.yaml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
count: [50, 100, 150]
|
count: [50, 100, 150]
|
||||||
runs-on: ubuntu-latest-16-cores
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'projectdiscovery/nuclei'
|
if: github.repository == 'projectdiscovery/nuclei'
|
||||||
env:
|
env:
|
||||||
LIST_FILE: "/tmp/targets-${{ matrix.count }}.txt"
|
LIST_FILE: "/tmp/targets-${{ matrix.count }}.txt"
|
||||||
|
|||||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@ -14,6 +14,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: projectdiscovery/actions/setup/go@v1
|
- uses: projectdiscovery/actions/setup/go@v1
|
||||||
|
- uses: docker/setup-qemu-action@v3
|
||||||
|
- uses: docker/setup-buildx-action@v3
|
||||||
|
- uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
- uses: projectdiscovery/actions/goreleaser@v1
|
- uses: projectdiscovery/actions/goreleaser@v1
|
||||||
with:
|
with:
|
||||||
release: true
|
release: true
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
version: 2
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod download
|
- go mod download
|
||||||
@ -44,6 +46,26 @@ archives:
|
|||||||
checksum:
|
checksum:
|
||||||
algorithm: sha256
|
algorithm: sha256
|
||||||
|
|
||||||
|
dockers:
|
||||||
|
- image_templates:
|
||||||
|
- "{{ .ProjectName }}:{{ .Tag }}"
|
||||||
|
- "{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}"
|
||||||
|
- "{{ .ProjectName }}:v{{ .Major }}"
|
||||||
|
- "{{ .ProjectName }}:latest"
|
||||||
|
dockerfile: Dockerfile.goreleaser
|
||||||
|
use: buildx
|
||||||
|
build_flag_templates:
|
||||||
|
- "--pull"
|
||||||
|
- "--label=org.opencontainers.image.authors=ProjectDiscovery"
|
||||||
|
- "--label=org.opencontainers.image.created={{ .Date }}"
|
||||||
|
- "--label=org.opencontainers.image.description=\"Nuclei is a fast, customizable vulnerability scanner powered by the global security community and built on a simple YAML-based DSL, enabling collaboration to tackle trending vulnerabilities on the internet. It helps you find vulnerabilities in your applications, APIs, networks, DNS, and cloud configurations.\""
|
||||||
|
- "--label=org.opencontainers.image.licenses=MIT"
|
||||||
|
- "--label=org.opencontainers.image.ref.name={{ .Tag }}"
|
||||||
|
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
|
||||||
|
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
|
||||||
|
- "--label=org.opencontainers.image.url=https://github.com/projectdiscovery/{{ .ProjectName }}"
|
||||||
|
- "--label=org.opencontainers.image.version={{ .Version }}"
|
||||||
|
|
||||||
announce:
|
announce:
|
||||||
slack:
|
slack:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
15
Dockerfile
15
Dockerfile
@ -1,15 +1,16 @@
|
|||||||
# Build
|
# Build
|
||||||
FROM golang:1.22-alpine AS build-env
|
FROM golang:1.22-alpine AS builder
|
||||||
|
|
||||||
RUN apk add build-base
|
RUN apk add build-base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
RUN go mod download
|
RUN make verify
|
||||||
RUN go build ./cmd/nuclei
|
RUN make build
|
||||||
|
|
||||||
# Release
|
# Release
|
||||||
FROM alpine:3.18.6
|
FROM alpine:latest
|
||||||
RUN apk upgrade --no-cache \
|
|
||||||
&& apk add --no-cache bind-tools chromium ca-certificates
|
RUN apk add --no-cache bind-tools chromium ca-certificates
|
||||||
COPY --from=build-env /app/nuclei /usr/local/bin/
|
COPY --from=builder /app/bin/nuclei /usr/local/bin/
|
||||||
|
|
||||||
ENTRYPOINT ["nuclei"]
|
ENTRYPOINT ["nuclei"]
|
||||||
6
Dockerfile.goreleaser
Normal file
6
Dockerfile.goreleaser
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN apk add --no-cache bind-tools chromium ca-certificates
|
||||||
|
COPY nuclei /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["nuclei"]
|
||||||
Loading…
x
Reference in New Issue
Block a user