Skip to content

Commit

Permalink
fix: Add COPY instead of ADD in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Jan 8, 2025
1 parent 32a2efd commit 24e5be6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions docker/images/kuzzle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ RUN set -x \

WORKDIR /app

ADD ./bin bin
ADD ./config config
ADD ./lib lib
ADD ./package.json package.json
ADD ./package-lock.json package-lock.json
ADD ./index.ts index.ts
ADD ./tsconfig.json tsconfig.json
ADD ./check-node-version.js check-node-version.js
COPY ./bin bin
COPY ./config config
COPY ./lib lib
COPY ./package.json package.json
COPY ./package-lock.json package-lock.json
COPY ./index.ts index.ts
COPY ./tsconfig.json tsconfig.json
COPY ./check-node-version.js check-node-version.js

Check notice

Code scanning / SonarCloud

Prefer COPY over ADD for copying local resources Low

Replace this ADD instruction with a COPY instruction. See more on SonarQube Cloud

RUN npm ci
RUN npm run build
RUN npm prune --omit=dev

RUN rm -rf tsconfig.json index.ts

ADD ./plugins/available/ /app/plugins/available/
COPY ./plugins/available/ /app/plugins/available/

################################################################################
FROM node:${NODE_VERSION}-bookworm-slim AS minifier
Expand Down Expand Up @@ -71,8 +71,8 @@ COPY --from=minifier /app /var/app

ENV NODE_ENV=production

ADD ./docker/scripts/entrypoint.sh /bin/entrypoint
ADD ./docker/scripts/run-prod.sh /bin/kuzzle
COPY ./docker/scripts/entrypoint.sh /bin/entrypoint
COPY ./docker/scripts/run-prod.sh /bin/kuzzle

RUN ln -s /var/app /app

Expand Down
22 changes: 11 additions & 11 deletions docker/images/plugin-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ RUN set -x \

WORKDIR /app

ADD ./bin bin
ADD ./config config
ADD ./lib lib
ADD ./package.json package.json
ADD ./package-lock.json package-lock.json
ADD ./index.ts index.ts
ADD ./tsconfig.json tsconfig.json
ADD ./check-node-version.js check-node-version.js
COPY ./bin bin
COPY ./config config
COPY ./lib lib
COPY ./package.json package.json
COPY ./package-lock.json package-lock.json
COPY ./index.ts index.ts
COPY ./tsconfig.json tsconfig.json
COPY ./check-node-version.js check-node-version.js

Check notice

Code scanning / SonarCloud

Prefer COPY over ADD for copying local resources Low

Replace this ADD instruction with a COPY instruction. See more on SonarQube Cloud

RUN npm ci
RUN npm run build
RUN npm prune --omit=dev

RUN rm -rf tsconfig.json index.ts

ADD ./plugins/available/ plugins/available/
COPY ./plugins/available/ plugins/available/

################################################################################
FROM node:${NODE_VERSION}-bookworm-slim
Expand All @@ -42,8 +42,8 @@ RUN set -x \
&& apt-get update && apt-get install -y \
libunwind-dev

ADD ./docker/scripts/entrypoint.sh /bin/entrypoint
ADD ./docker/scripts/run-plugin.sh /bin/run-plugin
COPY ./docker/scripts/entrypoint.sh /bin/entrypoint
COPY ./docker/scripts/run-plugin.sh /bin/run-plugin

COPY --from=builder /lib /lib
COPY --from=builder /usr /usr
Expand Down

0 comments on commit 24e5be6

Please sign in to comment.