-
-
Notifications
You must be signed in to change notification settings - Fork 348
/
Dockerfile.metadata
59 lines (44 loc) · 2.23 KB
/
Dockerfile.metadata
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Everything we need in both the build and prod images
FROM ubuntu:22.04 AS base
# Don't prompt for time zone
ENV DEBIAN_FRONTEND noninteractive
# Put user-installed Python code in path
ENV PATH "$PATH:/root/.local/bin"
# Install Git and Python
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates gnupg git libffi-dev \
python3 python-is-python3
# Trust all git repos
RUN git config --global --add safe.directory '*'
# Set up Mono's APT repo
RUN gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update
# Install the necessary pieces of Mono
RUN apt-get install -y --no-install-recommends \
mono-runtime ca-certificates-mono libmono-microsoft-csharp4.0-cil libmono-system-data4.0-cil libmono-system-runtime-serialization4.0-cil libmono-system-transactions4.0-cil libmono-system-net-http-webrequest4.0-cil libmono-system-servicemodel4.0a-cil
# Isolate Python build stuff in a separate container
FROM base AS build
# Install Python build deps
RUN apt-get install -y --no-install-recommends \
python3-pip python3-setuptools python3-dev
# Install the meta tester's Python code and its Infra dep
ENV PIP_ROOT_USER_ACTION ignore
ENV PIP_BREAK_SYSTEM_PACKAGES 1
RUN pip3 install --upgrade pip
RUN pip3 install 'git+https://github.com/KSP-CKAN/NetKAN-Infra#subdirectory=netkan'
RUN pip3 install 'git+https://github.com/KSP-CKAN/xKAN-meta_testing'
# Prune unused deps
RUN pip3 --no-input uninstall -y flask gunicorn werkzeug
# The image we'll actually use
FROM base as prod
# Purge APT download cache, package lists, and logs
RUN apt-get clean \
&& rm -r /var/lib/apt/lists /var/log/dpkg.log /var/log/apt
# Extract built Python packages from the build image
COPY --from=build /usr/local /usr/local
# Install the .NET assemblies the meta tester uses
ADD netkan.exe /usr/local/bin/.
ADD ckan.exe /usr/local/bin/.
ENTRYPOINT ["ckanmetatester"]