2019-11-29 11:57:18 +01:00
|
|
|
ARG DOCKER_VERSION=19.03.5
|
|
|
|
ARG PYTHON_VERSION=3.7.5
|
2019-07-10 17:29:05 +02:00
|
|
|
ARG BUILD_ALPINE_VERSION=3.10
|
2019-04-10 21:05:02 +02:00
|
|
|
ARG BUILD_DEBIAN_VERSION=slim-stretch
|
2019-11-29 11:57:18 +01:00
|
|
|
ARG RUNTIME_ALPINE_VERSION=3.10.3
|
|
|
|
ARG RUNTIME_DEBIAN_VERSION=stretch-20191118-slim
|
2015-02-23 12:01:37 +01:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
ARG BUILD_PLATFORM=alpine
|
2015-02-25 14:52:55 +01:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
FROM docker:${DOCKER_VERSION} AS docker-cli
|
2015-09-16 22:45:26 +02:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
FROM python:${PYTHON_VERSION}-alpine${BUILD_ALPINE_VERSION} AS build-alpine
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
bash \
|
|
|
|
build-base \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
libc-dev \
|
|
|
|
libffi-dev \
|
|
|
|
libgcc \
|
|
|
|
make \
|
|
|
|
musl-dev \
|
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
|
|
|
python2 \
|
|
|
|
python2-dev \
|
|
|
|
zlib-dev
|
|
|
|
ENV BUILD_BOOTLOADER=1
|
2015-08-25 00:54:59 +02:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
FROM python:${PYTHON_VERSION}-${BUILD_DEBIAN_VERSION} AS build-debian
|
2019-09-21 17:40:58 +02:00
|
|
|
RUN apt-get update && apt-get install --no-install-recommends -y \
|
2019-04-10 21:05:02 +02:00
|
|
|
curl \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
libc-dev \
|
2019-09-21 17:40:58 +02:00
|
|
|
libffi-dev \
|
2019-04-10 21:05:02 +02:00
|
|
|
libgcc-6-dev \
|
2019-09-21 17:40:58 +02:00
|
|
|
libssl-dev \
|
2019-04-10 21:05:02 +02:00
|
|
|
make \
|
|
|
|
openssl \
|
2019-09-21 17:40:58 +02:00
|
|
|
python2.7-dev \
|
|
|
|
zlib1g-dev
|
2014-07-30 22:11:11 +02:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
FROM build-${BUILD_PLATFORM} AS build
|
|
|
|
COPY docker-compose-entrypoint.sh /usr/local/bin/
|
|
|
|
ENTRYPOINT ["sh", "/usr/local/bin/docker-compose-entrypoint.sh"]
|
|
|
|
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
|
|
|
|
WORKDIR /code/
|
2019-02-05 10:51:26 +01:00
|
|
|
# FIXME(chris-crone): virtualenv 16.3.0 breaks build, force 16.2.0 until fixed
|
|
|
|
RUN pip install virtualenv==16.2.0
|
2019-02-14 12:20:15 +01:00
|
|
|
RUN pip install tox==2.9.1
|
2015-07-03 04:35:20 +02:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
COPY requirements.txt .
|
|
|
|
COPY requirements-dev.txt .
|
|
|
|
COPY .pre-commit-config.yaml .
|
|
|
|
COPY tox.ini .
|
|
|
|
COPY setup.py .
|
|
|
|
COPY README.md .
|
|
|
|
COPY compose compose/
|
2015-09-16 22:45:26 +02:00
|
|
|
RUN tox --notest
|
2019-04-10 21:05:02 +02:00
|
|
|
COPY . .
|
|
|
|
ARG GIT_COMMIT=unknown
|
|
|
|
ENV DOCKER_COMPOSE_GITSHA=$GIT_COMMIT
|
|
|
|
RUN script/build/linux-entrypoint
|
2015-08-24 21:15:08 +02:00
|
|
|
|
2019-04-10 21:05:02 +02:00
|
|
|
FROM alpine:${RUNTIME_ALPINE_VERSION} AS runtime-alpine
|
|
|
|
FROM debian:${RUNTIME_DEBIAN_VERSION} AS runtime-debian
|
|
|
|
FROM runtime-${BUILD_PLATFORM} AS runtime
|
|
|
|
COPY docker-compose-entrypoint.sh /usr/local/bin/
|
|
|
|
ENTRYPOINT ["sh", "/usr/local/bin/docker-compose-entrypoint.sh"]
|
|
|
|
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
|
|
|
|
COPY --from=build /usr/local/bin/docker-compose /usr/local/bin/docker-compose
|