-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
32 lines (22 loc) · 1.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# we use a later python and alpine so that the most up to date py3-cryptography can be pulled in
# this stops the requirement for rust be dragged in (causing much "fun" in so far as the image size bloats
# to approx 2Gb!)
FROM python:3.11-alpine3.16
# py3-cryptography is added here as a means to get python cryptography onto the image (prebuilt) and without
# need to install rust compiler
RUN apk add --no-cache gnupg libressl tar ca-certificates gcc cmake make libc-dev coreutils g++ libzmq zeromq zeromq-dev git curl-dev libffi libffi-dev libbz2 bzip2-dev xz-dev libjpeg jpeg-dev py3-cryptography
# This little bit of magic caches the dependencies in a docker layer, so that
# rebuilds locally are not so expensive
COPY acurl/setup.cfg /acurl-setup.cfg
COPY setup.cfg /mite-setup.cfg
RUN python3 -c "import configparser; c = configparser.ConfigParser(); c.read('/mite-setup.cfg'); print(c['options']['install_requires'])" | grep -v acurl | xargs pip install
RUN python3 -c "import configparser; c = configparser.ConfigParser(); c.read('/acurl-setup.cfg'); print(c['options']['install_requires'])" | xargs pip install
ADD . / /mite/
WORKDIR /mite/acurl
RUN pip install --no-cache-dir -e .
WORKDIR /mite
RUN pip install --no-cache-dir -e .[amqp]
# We can't dockerignore the .git directory because we need it for calculating
# the scm-version
RUN rm -r /mite/.git
RUN apk del -r gnupg tar gcc cmake make libc-dev g++ zeromq-dev git