Reduced loadgenerator's image size (#52)

Reduce loadgenerator's image size from ~972MB to ~117MB

* Changed loadgen.sh to execute with `/bin/sh` as opposed to `/bin/bash`
* Changed dockerfile to a multi stage build
* Changed base image to `python:3-alpine` as opposed to `python:3.6`
This commit is contained in:
Colin Nelson 2018-09-26 09:18:23 -07:00 committed by Ahmet Alp Balkan
parent 2924250449
commit 1263da2172
2 changed files with 17 additions and 3 deletions

View file

@ -1,7 +1,21 @@
FROM python:3.6
FROM python:3-alpine as base
FROM base as builder
RUN apk add --update --no-cache \
gcc \
linux-headers \
make \
musl-dev \
python-dev \
g++
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN pip install --install-option="--prefix=/install" -r requirements.txt
FROM base
COPY --from=builder /install /usr/local
COPY . .
ENTRYPOINT ./loadgen.sh

View file

@ -1,4 +1,4 @@
#!/bin/bash -eu
#!/bin/sh -eu
#
# Copyright 2018 Google LLC
#