Skip to content

Commit

Permalink
refactor dockerfiles and update gitattributes (vdaas#2743)
Browse files Browse the repository at this point in the history
* refactor dockerfiles and update gitattributes

Signed-off-by: kpango <kpango@vdaas.org>

* Update .gitattributes

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Yusuke Kato <kpango@vdaas.org>

---------

Signed-off-by: kpango <kpango@vdaas.org>
Signed-off-by: Yusuke Kato <kpango@vdaas.org>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and takuyaymd committed Dec 2, 2024
1 parent 6019b0f commit 2dcce5e
Show file tree
Hide file tree
Showing 29 changed files with 102 additions and 28 deletions.
50 changes: 48 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
* text encoding=utf-8 eol=lf

# https://github.com/github/linguist/blob/master/docs/overrides.md
.all-contributorsrc linguist-language=JSON
*.config text encoding=utf-8 eol=lf
*.cpp text encoding=utf-8 eol=lf diff=cpp
*.css text encoding=utf-8 eol=lf
*.csv text encoding=utf-8 eol=lf linguist-language=CSV
*.go text encoding=utf-8 eol=lf diff=go
*.h text encoding=utf-8 eol=lf diff=cpp
*.hpp text encoding=utf-8 eol=lf diff=cpp
*.json text encoding=utf-8 eol=lf diff=json linguist-language=JSON
*.md text encoding=utf-8 eol=lf
*.proto text encoding=utf-8 eol=lf diff=proto
*.py text encoding=utf-8 eol=lf diff=python
*.rs text encoding=utf-8 eol=lf diff=rust
*.txt text encoding=utf-8 eol=lf
*.xml text encoding=utf-8 eol=lf diff=html
*.yaml text encoding=utf-8 eol=lf
*.yml text encoding=utf-8 eol=lf
.all-contributorsrc text encoding=utf-8 eol=lf linguist-language=JSON
Dockerfile text encoding=utf-8 eol=lf
LICENSE text encoding=utf-8 eol=lf


*.a binary
*.gz binary
*.jpeg binary
*.o binary
*.pdf binary
*.so binary
*.zip binary
*.jpg binary filter=lfs diff=lfs merge=lfs -text
*.png binary filter=lfs diff=lfs merge=lfs -text
*.ai binary filter=lfs diff=lfs merge=lfs -text
*.psd binary filter=lfs diff=lfs merge=lfs -text

*.json merge=ours
*.mod merge=ours
*.sum merge=ours
*.svg merge=ours


vendor/** linguist-vendored

*.tmp export-ignore
*.tmp.* export-ignore
*~ export-ignore
.DS_Store export-ignore
.~lock.* export-ignore
Thumbs.db export-ignore
3 changes: 2 additions & 1 deletion dockers/agent/core/agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -93,4 +94,4 @@ LABEL maintainer="vdaas.org vald team <vald@vdaas.org>"
COPY --from=builder /usr/bin/agent /usr/bin/agent
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/agent"]
ENTRYPOINT ["/usr/bin/agent"]
3 changes: 2 additions & 1 deletion dockers/agent/core/faiss/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -95,4 +96,4 @@ COPY --from=builder /usr/bin/faiss /usr/bin/faiss
COPY cmd/agent/core/faiss/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/faiss"]
ENTRYPOINT ["/usr/bin/faiss"]
3 changes: 2 additions & 1 deletion dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -94,4 +95,4 @@ COPY --from=builder /usr/bin/ngt /usr/bin/ngt
COPY cmd/agent/core/ngt/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/ngt"]
ENTRYPOINT ["/usr/bin/ngt"]
3 changes: 2 additions & 1 deletion dockers/agent/sidecar/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -84,4 +85,4 @@ LABEL maintainer="vdaas.org vald team <vald@vdaas.org>"
COPY --from=builder /usr/bin/sidecar /usr/bin/sidecar
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/sidecar"]
ENTRYPOINT ["/usr/bin/sidecar"]
3 changes: 2 additions & 1 deletion dockers/binfmt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand All @@ -16,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM tonistiigi/binfmt:master AS builder
FROM tonistiigi/binfmt:master AS builder
3 changes: 2 additions & 1 deletion dockers/buildbase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand All @@ -16,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM ubuntu:devel AS builder
FROM ubuntu:devel AS builder
3 changes: 2 additions & 1 deletion dockers/buildkit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand All @@ -16,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM moby/buildkit:master AS builder
FROM moby/buildkit:master AS builder
3 changes: 2 additions & 1 deletion dockers/buildkit/syft/scanner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand All @@ -16,4 +17,4 @@
#

# DO_NOT_EDIT this Dockerfile is generated by https://github.com/vdaas/vald/blob/main/hack/docker/gen/main.go
FROM docker/buildkit-syft-scanner:edge AS scanner
FROM docker/buildkit-syft-scanner:edge AS scanner
3 changes: 2 additions & 1 deletion dockers/ci/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -127,4 +128,4 @@ RUN --mount=type=bind,target=.,rw \
&& rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/*
# skipcq: DOK-DL3002
USER root:root
ENTRYPOINT ["/bin/bash"]
ENTRYPOINT ["/bin/bash"]
3 changes: 2 additions & 1 deletion dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -145,4 +146,4 @@ RUN --mount=type=bind,target=.,rw \
&& make faiss/install \
&& rm -rf ${GOPATH}/src/github.com/${ORG}/${REPO}/*
# skipcq: DOK-DL3002
USER root:root
USER root:root
3 changes: 2 additions & 1 deletion dockers/discoverer/k8s/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/discoverer /usr/bin/discoverer
COPY cmd/discoverer/k8s/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/discoverer"]
ENTRYPOINT ["/usr/bin/discoverer"]
3 changes: 2 additions & 1 deletion dockers/example/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -92,4 +93,4 @@ LABEL maintainer="vdaas.org vald team <vald@vdaas.org>"
COPY --from=builder /usr/bin/client /usr/bin/client
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/client"]
ENTRYPOINT ["/usr/bin/client"]
3 changes: 2 additions & 1 deletion dockers/gateway/filter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/filter /usr/bin/filter
COPY cmd/gateway/filter/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/filter"]
ENTRYPOINT ["/usr/bin/filter"]
3 changes: 2 additions & 1 deletion dockers/gateway/lb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/lb /usr/bin/lb
COPY cmd/gateway/lb/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/lb"]
ENTRYPOINT ["/usr/bin/lb"]
3 changes: 2 additions & 1 deletion dockers/gateway/mirror/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/mirror /usr/bin/mirror
COPY cmd/gateway/mirror/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/mirror"]
ENTRYPOINT ["/usr/bin/mirror"]
3 changes: 2 additions & 1 deletion dockers/index/job/correction/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-correction /usr/bin/index-correction
COPY cmd/index/job/correction/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-correction"]
ENTRYPOINT ["/usr/bin/index-correction"]
3 changes: 2 additions & 1 deletion dockers/index/job/creation/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-creation /usr/bin/index-creation
COPY cmd/index/job/creation/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-creation"]
ENTRYPOINT ["/usr/bin/index-creation"]
3 changes: 2 additions & 1 deletion dockers/index/job/deletion/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-deletion /usr/bin/index-deletion
COPY cmd/index/job/deletion/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-deletion"]
ENTRYPOINT ["/usr/bin/index-deletion"]
3 changes: 2 additions & 1 deletion dockers/index/job/readreplica/rotate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/readreplica-rotate /usr/bin/readreplica-rotate
COPY cmd/index/job/readreplica/rotate/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/readreplica-rotate"]
ENTRYPOINT ["/usr/bin/readreplica-rotate"]
3 changes: 2 additions & 1 deletion dockers/index/job/save/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-save /usr/bin/index-save
COPY cmd/index/job/save/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-save"]
ENTRYPOINT ["/usr/bin/index-save"]
3 changes: 2 additions & 1 deletion dockers/index/operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index-operator /usr/bin/index-operator
COPY cmd/index/operator/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index-operator"]
ENTRYPOINT ["/usr/bin/index-operator"]
3 changes: 2 additions & 1 deletion dockers/manager/index/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/index /usr/bin/index
COPY cmd/manager/index/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/index"]
ENTRYPOINT ["/usr/bin/index"]
3 changes: 2 additions & 1 deletion dockers/operator/helm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -106,4 +107,4 @@ COPY --from=builder /opt/helm/charts/vald /opt/helm/charts/vald
COPY --from=builder /opt/helm/charts/vald-helm-operator /opt/helm/charts/vald-helm-operator
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"]
ENTRYPOINT ["/usr/bin/helm-operator", "run", "--watches-file=/opt/helm/watches.yaml"]
3 changes: 2 additions & 1 deletion dockers/tools/benchmark/job/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -93,4 +94,4 @@ COPY --from=builder /usr/bin/job /usr/bin/job
COPY cmd/tools/benchmark/job/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/job"]
ENTRYPOINT ["/usr/bin/job"]
3 changes: 2 additions & 1 deletion dockers/tools/benchmark/operator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -85,4 +86,4 @@ COPY --from=builder /usr/bin/operator /usr/bin/operator
COPY cmd/tools/benchmark/operator/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/operator"]
ENTRYPOINT ["/usr/bin/operator"]
3 changes: 2 additions & 1 deletion dockers/tools/cli/loadtest/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syntax = docker/dockerfile:latest
# check=error=true
#
# Copyright (C) 2019-2024 vdaas.org vald team <vald@vdaas.org>
#
Expand Down Expand Up @@ -93,4 +94,4 @@ COPY --from=builder /usr/bin/loadtest /usr/bin/loadtest
COPY cmd/tools/cli/loadtest/sample.yaml /etc/server/config.yaml
# skipcq: DOK-DL3002
USER nonroot:nonroot
ENTRYPOINT ["/usr/bin/loadtest"]
ENTRYPOINT ["/usr/bin/loadtest"]
Loading

0 comments on commit 2dcce5e

Please sign in to comment.