Move from ADD to COPY on Dockerfiles

This commit is contained in:
claudijd 2022-07-05 16:40:42 -04:00 committed by Evan Gray
parent 73307397bc
commit 8221708ef0
12 changed files with 26 additions and 26 deletions

View File

@ -20,8 +20,8 @@ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
npm ci npm ci
COPY clients/js ./ COPY clients/js ./
ADD solana /usr/src/solana COPY solana /usr/src/solana
ADD proto /usr/src/proto COPY proto /usr/src/proto
WORKDIR /usr/src/solana WORKDIR /usr/src/solana

View File

@ -8,8 +8,8 @@ RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/certs/ca-certifi
RUN mkdir /app RUN mkdir /app
ADD tools/build.sh /app/tools/ COPY tools/build.sh /app/tools/
ADD tools/go.* /app/tools/ COPY tools/go.* /app/tools/
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \
cd /app/tools && CGO_ENABLED=0 ./build.sh cd /app/tools && CGO_ENABLED=0 ./build.sh
@ -24,8 +24,8 @@ RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/certs/ca-certifi
COPY --from=go-tools /app /app COPY --from=go-tools /app /app
ADD buf.* /app COPY buf.* /app
ADD proto /app/proto COPY proto /app/proto
RUN --mount=type=cache,target=/root/.cache \ RUN --mount=type=cache,target=/root/.cache \
cd /app && \ cd /app && \
@ -41,11 +41,11 @@ RUN if [ -e /certs/cert.pem ]; then cp /certs/cert.pem /etc/ssl/cert.pem; fi
COPY --from=go-tools /app /app COPY --from=go-tools /app /app
ADD buf.* /app COPY buf.* /app
ADD proto /app/proto COPY proto /app/proto
ADD tools/package.json /app/tools/ COPY tools/package.json /app/tools/
ADD tools/package-lock.json /app/tools/ COPY tools/package-lock.json /app/tools/
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/root/.npm \ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/root/.npm \
cd /app/tools && npm ci cd /app/tools && npm ci

View File

@ -1,3 +1,3 @@
FROM terramoney/localterra-core:2.0.1@sha256:73faa857d32b869b6bd3bf062351bd47ca5440d758dc07d5481424b9a9bdaede FROM terramoney/localterra-core:2.0.1@sha256:73faa857d32b869b6bd3bf062351bd47ca5440d758dc07d5481424b9a9bdaede
ADD config /root/.terra/config COPY config /root/.terra/config

View File

@ -24,9 +24,9 @@ RUN if [ -e /certs/cert.pem ]; then npm config set cafile /certs/cert.pem; fi
RUN if [ -e /certs/cert.pem ]; then git config --global http.sslCAInfo /certs/cert.pem; fi RUN if [ -e /certs/cert.pem ]; then git config --global http.sslCAInfo /certs/cert.pem; fi
# Only invalidate the npm install step if package.json changed # Only invalidate the npm install step if package.json changed
ADD --chown=node:node package.json . COPY --chown=node:node package.json .
ADD --chown=node:node package-lock.json . COPY --chown=node:node package-lock.json .
ADD --chown=node:node .env.test .env COPY --chown=node:node .env.test .env
# We want to cache node_modules *and* incorporate it into the final image. # We want to cache node_modules *and* incorporate it into the final image.
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
@ -39,4 +39,4 @@ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
# could be a renameat syscall. Alpine does not have this bug. # could be a renameat syscall. Alpine does not have this bug.
RUN rm -rf node_modules && mv node_modules_cache node_modules RUN rm -rf node_modules && mv node_modules_cache node_modules
ADD --chown=node:node . . COPY --chown=node:node . .

View File

@ -3,7 +3,7 @@ FROM docker.io/golang:1.17.0@sha256:06e92e576fc7a7067a268d47727f3083c0a564331bfc
WORKDIR /app WORKDIR /app
ADD . . COPY . .
WORKDIR /app/functions_server WORKDIR /app/functions_server
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \

View File

@ -11,12 +11,12 @@ RUN if [ -e /certs/cert.pem ]; then git config --global http.sslCAInfo /certs/ce
WORKDIR /app WORKDIR /app
ADD tools tools COPY tools tools
RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \
cd tools/ && go build -mod=readonly -o /dlv github.com/go-delve/delve/cmd/dlv cd tools/ && go build -mod=readonly -o /dlv github.com/go-delve/delve/cmd/dlv
ADD . . COPY . .
ARG GO_BUILD_ARGS=-race ARG GO_BUILD_ARGS=-race

View File

@ -9,7 +9,7 @@ RUN apk add python3 \
make \ make \
g++ g++
ADD . . COPY . .
RUN echo $(ls -1 .) RUN echo $(ls -1 .)
RUN echo $(less Dockerfile) RUN echo $(less Dockerfile)

View File

@ -36,7 +36,7 @@ RUN touch /tmp/foo.so && \
# Add bridge contract sources # Add bridge contract sources
WORKDIR /usr/src/bridge WORKDIR /usr/src/bridge
ADD . . COPY . .
ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=trace,solana_bpf_loader=debug,solana_rbpf=debug" ENV RUST_LOG="solana_runtime::system_instruction_processor=trace,solana_runtime::message_processor=trace,solana_bpf_loader=debug,solana_rbpf=debug"
ENV RUST_BACKTRACE=1 ENV RUST_BACKTRACE=1

View File

@ -1,3 +1,3 @@
FROM terramoney/localterra-core:bombay@sha256:0f93576ae0716f835b2adbd5ac550ef90063b536e99c4dd682b6dd905927f261 FROM terramoney/localterra-core:bombay@sha256:0f93576ae0716f835b2adbd5ac550ef90063b536e99c4dd682b6dd905927f261
ADD config /root/.terra/config COPY config /root/.terra/config

View File

@ -4,7 +4,7 @@ RUN apt update && apt install curl git gcc libc-dev
WORKDIR /app WORKDIR /app
ADD go.mod . COPY go.mod .
ADD go.sum . COPY go.sum .
RUN go build -o /bin/abigen github.com/celo-org/celo-blockchain/cmd/abigen RUN go build -o /bin/abigen github.com/celo-org/celo-blockchain/cmd/abigen

View File

@ -4,7 +4,7 @@ RUN apk add curl git gcc libc-dev linux-headers
WORKDIR /app WORKDIR /app
ADD go.mod . COPY go.mod .
ADD go.sum . COPY go.sum .
RUN go build -mod=readonly -o /bin/abigen github.com/ethereum/go-ethereum/cmd/abigen RUN go build -mod=readonly -o /bin/abigen github.com/ethereum/go-ethereum/cmd/abigen

View File

@ -95,7 +95,7 @@ RUN mkdir /data && chown redis:redis /data
VOLUME /data VOLUME /data
WORKDIR /data WORKDIR /data
ADD . . COPY . .
RUN chmod 777 /data/third_party/redis/docker-entrypoint.sh RUN chmod 777 /data/third_party/redis/docker-entrypoint.sh
RUN cp /data/third_party/redis/docker-entrypoint.sh /usr/local/bin/ RUN cp /data/third_party/redis/docker-entrypoint.sh /usr/local/bin/