-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
42 lines (29 loc) · 997 Bytes
/
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
33
34
35
36
37
38
39
40
41
42
# Build container
FROM python:3.8-slim AS build
RUN mkdir -pv /src
WORKDIR /src
RUN apt-get update && \
apt-get install git -y
COPY . /src
RUN python -m pip install -U setuptools==70.3.0 && \
python setup.py clean bdist_wheel
# Run container
FROM python:3.8-slim
LABEL license="Apache License 2.0" \
maintainer="Crate.IO GmbH <[email protected]>" \
name="CrateDB Kubernetes Operator" \
repository="crate/crate-operator"
WORKDIR /etc/cloud
RUN useradd -U -M crate-operator
RUN apt-get update && \
apt-get upgrade -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /src/dist /wheels
RUN pip install --no-cache-dir -U pip wheel setuptools==70.3.0 && \
pip install --no-cache-dir /wheels/*.whl && \
rm -rf /wheels && \
ln -s "$(python -c "import pkgutil; main = pkgutil.get_loader('crate.operator.main'); print(main.path)")"
USER crate-operator
ENTRYPOINT ["kopf", "run", "--standalone", "-A"]
CMD ["main.py"]