_... ash scripts to install common tools on alpine
Self contained scripts that should run under the default sh on Alpine, ash.
Each script is intended to install something taking up very little disk.
Generally we use alpine within a docker container. So we apologise if the scripts look very much a long stream of ANDed dockerfile-run directives.
We take pull requests seriously ;)
Each script should only leave the packages required for the capability they install
E.g.
You might use wget to download terraform. However your installation script for
for terraform should remove it before completion as wget is not required
for terraform to run correctly.
Alpine is tiny. Seems a shame to bloat it up unnecessarily with lazy installs of other software.
The scripts generally delete all unneeded files and avoid file-system caches for package managers etc.
For creating containers using alpine as a base, these scripts will do stuff without polluting your Dockerfile or equivalent with lots of commands.
This keeps your Dockerfile readable but also allows for more complex logic during the build process inside your scripts without the creation of disk-consuming additional image layers.
cd /my/dir/with/Dockerfile
git clone https://github.com/opsgang/alpine_build_scripts.git
FROM gliderlabs/alpine:3.3
MAINTAINER jinal--shah <[email protected]>
LABEL Name="foo" Vendor="sortuniq" Version="0.0.1" Description="build foo"
ENV SCRIPT_DIR_LOCAL="alpine_build_scripts" \
SCRIPT_DIR="/var/tmp/scripts"
COPY $SCRIPT_DIR_LOCAL $SCRIPT_DIR/
RUN chmod a+x $SCRIPT_DIR/* \
&& $SCRIPT_DIR/install_awscli.sh \
&& $SCRIPT_DIR/install_essentials.sh \
&& rm -rf /var/cache/apk/* $SCRIPT_DIR
CMD ["/usr/bin/make", "-C", "my_project", "build"]