Skip to content

Commit

Permalink
Fix deepsource: dockerfile warning (#1835)
Browse files Browse the repository at this point in the history
* add pipefail option

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* delete cat command

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* fix warning

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* add skip flag

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* apt to apt-get

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* add quote

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* add skip flag

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* forgot to add

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

* fix skip type

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Yusuke Kato <kpango@vdaas.org>
  • Loading branch information
hlts2 and kpango authored Nov 18, 2022
1 parent 3b1fdee commit 77206ca
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions dockers/agent/core/ngt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ENV PKG agent/core/ngt
ENV PKG_INTERNAL agent/internal
ENV APP_NAME ngt

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
Expand Down
3 changes: 2 additions & 1 deletion dockers/agent/sidecar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ ENV PKG agent/sidecar
ENV PKG_INTERNAL agent/internal
ENV APP_NAME sidecar

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down
1 change: 1 addition & 0 deletions dockers/ci/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ENV PATH ${PATH}:${GOROOT}/bin:${GOPATH}/bin
COPY --from=golang /usr/local/go $GOROOT
RUN mkdir -p $GOPATH/src

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
Expand Down
3 changes: 3 additions & 0 deletions dockers/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ARG MAINTAINER="vdaas.org vald team <vald@vdaas.org>"

FROM ubuntu:devel AS builder

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
Expand All @@ -27,9 +28,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

WORKDIR /tmp

# skipcq: DOK-DL3026
FROM mcr.microsoft.com/vscode/devcontainers/go:1 AS base
LABEL maintainer "${MAINTAINER}"

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
Expand Down
3 changes: 2 additions & 1 deletion dockers/discoverer/k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ ENV REPO vald
ENV PKG discoverer/k8s
ENV APP_NAME discoverer

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down
3 changes: 2 additions & 1 deletion dockers/gateway/filter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ ENV REPO vald
ENV PKG gateway/filter
ENV APP_NAME filter

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down
3 changes: 2 additions & 1 deletion dockers/gateway/lb/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ ENV REPO vald
ENV PKG gateway/lb
ENV APP_NAME lb

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down
3 changes: 2 additions & 1 deletion dockers/manager/index/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ ENV REPO vald
ENV PKG manager/index
ENV APP_NAME index

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down
4 changes: 3 additions & 1 deletion dockers/operator/helm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ARG VALD_KIND="ValdRelease"
ARG VALD_HELM_OPERATOR_KIND="ValdHelmOperatorRelease"
ARG MAINTAINER="vdaas.org vald team <vald@vdaas.org>"

# skipcq: DOK-DL3026
FROM quay.io/operator-framework/helm-operator:${OPERATOR_SDK_VERSION} AS operator

FROM golang:${GO_VERSION} AS builder
Expand Down Expand Up @@ -81,7 +82,8 @@ RUN make helm/schema/vald
RUN make helm/schema/vald-helm-operator
RUN cp -r charts /charts

RUN apt clean \
# skipcq: DOK-DL3008
RUN apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/cache/* \
Expand Down
8 changes: 5 additions & 3 deletions dockers/tools/cli/loadtest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ENV REPO vald
ENV APP_NAME loadtest
ENV PKG tools/cli/${APP_NAME}

# skipcq: DOK-DL3008
RUN apt-get update && apt-get install -y --no-install-recommends \
upx \
git \
Expand All @@ -34,7 +35,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $GOPATH/src
RUN mkdir -p "$GOPATH/src"

WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}

Expand Down Expand Up @@ -62,8 +63,9 @@ WORKDIR ${GOPATH}/src/github.com/${ORG}/${REPO}
COPY versions/GO_VERSION .
COPY versions/VALD_VERSION .
COPY .git .
RUN GO_VERSION="$(cat GO_VERSION)" \
&& VALD_VERSION="$(cat VALD_VERSION)" \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN GO_VERSION="$(< GO_VERSION)" \
&& VALD_VERSION="$(< VALD_VERSION)" \
&& GIT_COMMIT="$(git rev-list -1 HEAD)" \
&& CPU_INFO_FLAGS="$(cat /proc/cpuinfo | grep flags | cut -d " " -f 2- | head -1)" \
&& GOOS="$(go env GOOS)" \
Expand Down

0 comments on commit 77206ca

Please sign in to comment.