Skip to content

Commit

Permalink
Remove additional --update for apk in Dockerfile (oxsecurity#2619)
Browse files Browse the repository at this point in the history
There is no need to use `--update` with `--no-cache` when using `apk` on
Alpine Linux, as using `--no-cache` will fetch the index every time and
leave no local cache, so the index will always be the latest without
temporary files remain in the image.
  • Loading branch information
PeterDaveHello authored and sanmai-NL committed Oct 4, 2023
1 parent 643880a commit 15a1159
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .automation/build.py
Expand Up @@ -448,7 +448,7 @@ def build_dockerfile(
apk_install_command = ""
if len(apk_packages) > 0:
apk_install_command = (
"RUN apk add --update --no-cache \\\n "
"RUN apk add --no-cache \\\n "
+ " \\\n ".join(list(dict.fromkeys(apk_packages)))
+ " \\\n && git config --global core.autocrlf true"
)
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -78,7 +78,7 @@ WORKDIR /
## @generated by .automation/build.py using descriptor files, please do not update manually ##
#############################################################################################
#APK__START
RUN apk add --update --no-cache \
RUN apk add --no-cache \
bash \
ca-certificates \
curl \
Expand Down

0 comments on commit 15a1159

Please sign in to comment.