mkdir followed by WORKDIR is redundant. WORKDIR will create a directory if it does not exist.
Removed apk update because apk upgrade will automatically update the cache.
Since apk update was already run there is no need to use the --no-cache flag for apk commands.
Reorganize commands to group similar ones.
We don't need to copy the tar.gz file to another directory, we can extract it from the location it already exists. We also don't need to delete the .tar.gz file as it is only used in an intermediate container and will not effect our final image.
Final image: remove apk update we do not need to update the cache since we are using --no-cache on the apk add call.
mkdir followed by WORKDIR is redundant. WORKDIR will create a directory if it does not exist.
Removed
apk update
becauseapk upgrade
will automatically update the cache.Since
apk update
was already run there is no need to use the--no-cache
flag for apk commands.Reorganize commands to group similar ones.
We don't need to copy the tar.gz file to another directory, we can extract it from the location it already exists. We also don't need to delete the .tar.gz file as it is only used in an intermediate container and will not effect our final image.
Final image: remove
apk update
we do not need to update the cache since we are using--no-cache
on theapk add
call.