Commit 33973515 authored by Jonathon Reinhart's avatar Jonathon Reinhart

Reduce size of builtin Docker images

1. Install `miniperl` instead of `perl` package

   While Alpine's `perl` package is 29.72 MB installed [1], `miniperl` is
   only 1.61 MB installed [2] and provides everything needed for `git
   submodule` to work.

2. Change ARM image from scaleway/alpine to multiarch/alpine:armhf-v3.4

   This is smaller, and is the base image for scaleway/alpine anyway [3].
   It is also more up-to-date (3.4 as opposed to 3.2.3).

3. Use `apk add --no-cache` instead of `apk add --update`

   This avoids local cache usage (recommended for Docker builds) [4].
   The --no-cache option was added in Alpine Linux 3.3.

[1]: http://pkgs.alpinelinux.org/package/edge/main/x86/perl
[2]: http://pkgs.alpinelinux.org/package/edge/main/x86/miniperl
[3]: https://github.com/scaleway/image-alpine/blob/e06ab285/Dockerfile#L5
[4]: https://github.com/gliderlabs/docker-alpine/blob/acfc8848/docs/usage.md#disabling-cache
parent 599b7833
FROM scaleway/alpine
FROM multiarch/alpine:armhf-v3.4
RUN apk add --no-cache bash ca-certificates git miniperl \
&& ln -s miniperl /usr/bin/perl
RUN apk add --update bash ca-certificates git perl
COPY ./ /usr/bin
FROM alpine
FROM alpine:3.4
RUN apk add --update bash ca-certificates git perl
RUN apk add --no-cache bash ca-certificates git miniperl \
&& ln -s miniperl /usr/bin/perl
COPY ./ /usr/bin
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment