Removing packages when creating alpine image
Hi.
In our work, we need custom Alpine docker and for that we need to remove
some packages from the final image[minirootfs] (basically, anything
that related to network/ssl)
We try to remove the packages from the container itself from inside, but doing “apk del ssl_client” for example, do nothing.
We also tried to edit the genrootfs script so after adding all the packages it will delete those we don’t want, but if I do:
<code class="text">
${APK:-apk} del --keys-dir "$keys_dir" \
--repositories-file "$repositories_file" \
*--root "$tmp"* $unwanted_packages
</code>
The script crash, and if I remove —root “$tmp” I receive permissions error, probably since it tries to delete the container packages.
Is there any way to accomplish what we want? maybe prevent “apk add” to install those packages?
(from redmine: issue id 10285, created on 2019-04-18)