diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-12-31 11:45:07 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-12-31 12:47:10 +0000 |
| commit | 49aa01cc85881401b4863fee7eb2d1a0b24daa93 (patch) | |
| tree | 84073e368d45bdcabe00e1fa4b71bc5cae540d39 /syz-cluster | |
| parent | d32f762a1f4d1a1e4bd4b116b42b5cd263892f71 (diff) | |
syz-cluster: refactor Dockerfiles
Copy everything into the build context.
Add a .dockerignore file to avoid copying the definitely unnecessary
files and folders.
Check copyrights presence in Dockerfiles.
Diffstat (limited to 'syz-cluster')
| -rw-r--r-- | syz-cluster/controller/Dockerfile | 11 | ||||
| -rw-r--r-- | syz-cluster/dashboard/Dockerfile | 12 | ||||
| -rw-r--r-- | syz-cluster/email-reporter/Dockerfile | 13 | ||||
| -rw-r--r-- | syz-cluster/reporter-server/Dockerfile | 11 | ||||
| -rw-r--r-- | syz-cluster/series-tracker/Dockerfile | 10 | ||||
| -rw-r--r-- | syz-cluster/tools/db-mgmt/Dockerfile | 11 | ||||
| -rw-r--r-- | syz-cluster/tools/send-test-email/Dockerfile | 15 | ||||
| -rw-r--r-- | syz-cluster/workflow/boot-step/Dockerfile | 8 | ||||
| -rw-r--r-- | syz-cluster/workflow/build-step/Dockerfile | 4 | ||||
| -rw-r--r-- | syz-cluster/workflow/fuzz-step/Dockerfile | 1 | ||||
| -rw-r--r-- | syz-cluster/workflow/triage-step/Dockerfile | 10 |
11 files changed, 36 insertions, 70 deletions
diff --git a/syz-cluster/controller/Dockerfile b/syz-cluster/controller/Dockerfile index 8b48aa279..9a2ebd5c6 100644 --- a/syz-cluster/controller/Dockerfile +++ b/syz-cluster/controller/Dockerfile @@ -1,17 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS controller-builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY pkg/gcs/ pkg/gcs/ -COPY pkg/osutil/ pkg/osutil/ # Build the tool. -COPY syz-cluster/controller/ syz-cluster/controller/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/controller /build/syz-cluster/controller # Build the container. diff --git a/syz-cluster/dashboard/Dockerfile b/syz-cluster/dashboard/Dockerfile index 42b64f4da..44211df1e 100644 --- a/syz-cluster/dashboard/Dockerfile +++ b/syz-cluster/dashboard/Dockerfile @@ -1,18 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS dashboard-builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY pkg/gcs/ pkg/gcs/ -COPY pkg/osutil/ pkg/osutil/ -COPY pkg/html/urlutil/ pkg/html/urlutil/ # Build the tool. -COPY syz-cluster/dashboard/ syz-cluster/dashboard/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/web-dashboard /build/syz-cluster/dashboard # Build the container. diff --git a/syz-cluster/email-reporter/Dockerfile b/syz-cluster/email-reporter/Dockerfile index c2ac55a9f..21a10339f 100644 --- a/syz-cluster/email-reporter/Dockerfile +++ b/syz-cluster/email-reporter/Dockerfile @@ -1,19 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS email-reporter-builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY pkg/ pkg/ -COPY prog/ prog/ -COPY sys/targets/ sys/targets/ -COPY dashboard/dashapi/ dashboard/dashapi/ # Build the tool. -COPY syz-cluster/email-reporter/ syz-cluster/email-reporter/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/email-reporter /build/syz-cluster/email-reporter # Build the container. diff --git a/syz-cluster/reporter-server/Dockerfile b/syz-cluster/reporter-server/Dockerfile index 82f34946c..1280ab9ed 100644 --- a/syz-cluster/reporter-server/Dockerfile +++ b/syz-cluster/reporter-server/Dockerfile @@ -1,17 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS reporter-builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY pkg/gcs/ pkg/gcs/ -COPY pkg/osutil/ pkg/osutil/ # Build the tool. -COPY syz-cluster/reporter-server/ syz-cluster/reporter-server/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/reporter-server /build/syz-cluster/reporter-server # Build the container. diff --git a/syz-cluster/series-tracker/Dockerfile b/syz-cluster/series-tracker/Dockerfile index 697c31d82..a9ea9029e 100644 --- a/syz-cluster/series-tracker/Dockerfile +++ b/syz-cluster/series-tracker/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs # Copyright 2024 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. @@ -10,14 +11,7 @@ COPY go.mod go.sum ./ RUN go mod download # Build the tool. -COPY pkg/ pkg/ -# TODO: get rid of this dependency. -COPY prog/ prog/ -COPY dashboard/dashapi/ dashboard/dashapi/ -COPY sys/targets/ sys/targets/ -COPY syz-cluster/series-tracker/*.go syz-cluster/series-tracker/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ - +COPY --exclude=.git . . RUN go build -o /build/series-tracker-bin /build/syz-cluster/series-tracker FROM ubuntu:latest diff --git a/syz-cluster/tools/db-mgmt/Dockerfile b/syz-cluster/tools/db-mgmt/Dockerfile index 31c3b12d3..9ea856821 100644 --- a/syz-cluster/tools/db-mgmt/Dockerfile +++ b/syz-cluster/tools/db-mgmt/Dockerfile @@ -1,17 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY pkg/gcs/ pkg/gcs/ -COPY pkg/osutil/ pkg/osutil/ # Build the tool. -COPY syz-cluster/tools/db-mgmt/*.go syz-cluster/tools/db-mgmt/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/db-mgmt /build/syz-cluster/tools/db-mgmt # Create the actual container. diff --git a/syz-cluster/tools/send-test-email/Dockerfile b/syz-cluster/tools/send-test-email/Dockerfile index 69706aff0..0a66349c2 100644 --- a/syz-cluster/tools/send-test-email/Dockerfile +++ b/syz-cluster/tools/send-test-email/Dockerfile @@ -1,21 +1,16 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. FROM golang:1.24-alpine AS builder WORKDIR /build # Prepare the dependencies. -COPY go.mod ./ -COPY go.sum ./ +COPY go.mod go.sum ./ RUN go mod download -COPY dashboard/dashapi/ dashboard/dashapi/ -COPY pkg/gcs/ pkg/gcs/ -COPY pkg/email/ pkg/email/ -COPY pkg/auth/ pkg/auth/ -COPY pkg/gcpsecret/ pkg/gcpsecret/ # Build the tool. -COPY syz-cluster/tools/send-test-email/*.go syz-cluster/tools/send-test-email/ -COPY dashboard/dashapi/ dashboard/dashapi/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY --exclude=.git . . RUN go build -o /bin/send-email /build/syz-cluster/tools/send-test-email # Create the actual container. diff --git a/syz-cluster/workflow/boot-step/Dockerfile b/syz-cluster/workflow/boot-step/Dockerfile index 573b13593..74e2a6627 100644 --- a/syz-cluster/workflow/boot-step/Dockerfile +++ b/syz-cluster/workflow/boot-step/Dockerfile @@ -17,15 +17,9 @@ WORKDIR /build # Copy the code and the dependencies. COPY go.mod go.sum ./ RUN go mod download -COPY pkg/ pkg/ -COPY prog/ prog/ -COPY vm/ vm/ -COPY executor/ executor/ -COPY dashboard/dashapi/ dashboard/dashapi/ +COPY . . # Copying from the builder to take the `make descriptions` result. COPY --from=syzkaller-builder /build/sys/ sys/ -COPY syz-cluster/workflow/boot-step/*.go syz-cluster/workflow/boot-step/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ RUN go build -o /bin/boot-step /build/syz-cluster/workflow/boot-step diff --git a/syz-cluster/workflow/build-step/Dockerfile b/syz-cluster/workflow/build-step/Dockerfile index c3f2fb037..7f8849ffd 100644 --- a/syz-cluster/workflow/build-step/Dockerfile +++ b/syz-cluster/workflow/build-step/Dockerfile @@ -7,9 +7,7 @@ FROM gcr.io/syzkaller/env AS build-step-builder WORKDIR /build COPY go.mod go.sum ./ RUN go mod download -COPY --exclude=syz-cluster . . -COPY syz-cluster/workflow/build-step/*.go syz-cluster/workflow/build-step/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ +COPY . . RUN go build -o /build/build-step-bin /build/syz-cluster/workflow/build-step # Build on the latest syzbot image. diff --git a/syz-cluster/workflow/fuzz-step/Dockerfile b/syz-cluster/workflow/fuzz-step/Dockerfile index bc11e80da..c9466a509 100644 --- a/syz-cluster/workflow/fuzz-step/Dockerfile +++ b/syz-cluster/workflow/fuzz-step/Dockerfile @@ -10,7 +10,6 @@ COPY go.mod go.sum ./ RUN go mod download COPY . . RUN make TARGETARCH=amd64 -COPY syz-cluster/ syz-cluster/ RUN GO_FLAGS=$(make go-flags 2>/dev/null) && go build "$GO_FLAGS" -o /bin/fuzz-step /build/syz-cluster/workflow/fuzz-step FROM debian:bookworm diff --git a/syz-cluster/workflow/triage-step/Dockerfile b/syz-cluster/workflow/triage-step/Dockerfile index 67110b863..782a31e3d 100644 --- a/syz-cluster/workflow/triage-step/Dockerfile +++ b/syz-cluster/workflow/triage-step/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs # Copyright 2024 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. @@ -10,14 +11,7 @@ COPY go.mod go.sum ./ RUN go mod download # Build the tool. -COPY pkg/ pkg/ -# TODO: get rid of this dependency. -COPY prog/ prog/ -COPY dashboard/dashapi/ dashboard/dashapi/ -COPY sys/targets/ sys/targets/ -COPY syz-cluster/workflow/triage-step/*.go syz-cluster/workflow/triage-step/ -COPY syz-cluster/pkg/ syz-cluster/pkg/ - +COPY --exclude=.git . . RUN go build -o /build/triage-step-bin /build/syz-cluster/workflow/triage-step FROM ubuntu:latest |
