Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dockerfiles/cd/builders/tidb-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ ENV PATH /usr/local/go/bin/:$PATH
LABEL go-version="${GOLANG_VERSION}"

# Install nodejs.
RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash -
RUN yum -y install nodejs && yum clean all
RUN npm install -g pnpm@9.7.0
RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
yum -y install nodejs && yum clean all && \
npm install -g pnpm@9.12.2
Comment on lines +30 to +32
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To optimize the Docker image size, it's a good practice to clean the npm cache after installing packages. This can be done by adding npm cache clean --force to the RUN instruction.

RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
    yum -y install nodejs && yum clean all && \
    npm install -g pnpm@9.12.2 && npm cache clean --force


########### stage: non-root-builder, used for development with non-root user.
FROM builder AS non-root-builder
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/cd/builders/tidb-dashboard/centos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ ENV PATH /usr/local/go/bin/:$PATH
LABEL go-version="${GOLANG_VERSION}"

# Install nodejs.
RUN curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
RUN yum -y install nodejs && yum clean all
RUN npm install -g pnpm@7.30.5
RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
yum -y install nodejs && yum clean all && \
npm install -g pnpm@9.12.2
Comment on lines +33 to +35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To optimize the Docker image size, it's a good practice to clean the npm cache after installing packages. This can be done by adding npm cache clean --force to the RUN instruction.

RUN curl -fsSL https://rpm.nodesource.com/setup_22.x | bash - && \
    yum -y install nodejs && yum clean all && \
    npm install -g pnpm@9.12.2 && npm cache clean --force


########### stage: non-root-builder, used for development with non-root user.
FROM builder AS non-root-builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ profiles:
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .GIT }}-centos7-non-root-go1.25"
value: "{{ .GIT }}-centos7-non-root-go1.25-node22"
- op: add
path: /build/artifacts/0/docker/buildArgs
value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ profiles:
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .GIT }}-centos7-go1.25"
value: "{{ .GIT }}-centos7-go1.25-node22"
- op: add
path: /build/artifacts/0/docker/buildArgs
value:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ profiles:
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .GIT }}-non-root-go1.25"
value: "{{ .GIT }}-non-root-go1.25-node22"
- op: add
path: /build/artifacts/0/docker/buildArgs
value:
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/cd/builders/tidb-dashboard/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ profiles:
patches:
- op: replace
path: /build/tagPolicy/customTemplate/template
value: "{{ .GIT }}-go1.25"
value: "{{ .GIT }}-go1.25-node22"
- op: add
path: /build/artifacts/0/docker/buildArgs
value:
Expand Down
Loading