Skip to content

docker prefer COPY to ADD in dockerfile#15394

Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom
maipbui:docker-prefer-copy-to-add
Jun 22, 2023
Merged

docker prefer COPY to ADD in dockerfile#15394
qiluo-msft merged 1 commit intosonic-net:masterfrom
maipbui:docker-prefer-copy-to-add

Conversation

@maipbui
Copy link
Copy Markdown
Contributor

@maipbui maipbui commented Jun 8, 2023

Why I did it

Docker best practices prefer COPY to ADD
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy

Work item tracking
  • Microsoft ADO (number only): 17418730

How I did it

Use the COPY command as opposed to ADD unless working with a tar file.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@maipbui maipbui requested a review from qiluo-msft June 8, 2023 18:42
@maipbui maipbui marked this pull request as ready for review June 8, 2023 19:02
@maipbui maipbui requested a review from lguohan as a code owner June 8, 2023 19:02
@qiluo-msft qiluo-msft merged commit 110a3fd into sonic-net:master Jun 22, 2023
@maipbui maipbui deleted the docker-prefer-copy-to-add branch June 22, 2023 20:19
sonic-otn pushed a commit to sonic-otn/sonic-buildimage that referenced this pull request Sep 20, 2023
#### Why I did it
Docker best practices prefer COPY to ADD
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#add-or-copy
##### Work item tracking
- Microsoft ADO **(number only)**: 17418730

#### How I did it
Use the COPY command as opposed to ADD unless working with a tar file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants