-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
26 lines (24 loc) · 1.12 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
FROM alpine:3.18 as build
# Download helm binary and charts, use extra stage to keep final image small
RUN wget -O - https://get.helm.sh/helm-v3.8.1-linux-amd64.tar.gz | tar -xzO linux-amd64/helm > /helm
RUN chmod +x /helm \
&& /helm repo add bitnami https://charts.bitnami.com/bitnami \
&& /helm pull bitnami/postgresql --untar --version 11.9.13 --destination /charts \
&& /helm repo add yugabytedb https://charts.yugabyte.com \
&& /helm pull yugabytedb/yugabyte --untar --version 2.13.0 --destination /charts
FROM python:3.10-slim
RUN mkdir /operator
WORKDIR /operator
# Install python dependencies
COPY requirements.txt /operator/requirements.txt
RUN pip install -r /operator/requirements.txt && rm -rf /root/.cache/pip
# Copy downloaded helm charts
COPY --from=build /charts /operator/charts
COPY --from=build /helm /usr/local/bin/helm
# Copy operator code
COPY main.py /operator/
COPY hybridcloud /operator/hybridcloud
# Switch to extra user
RUN useradd -M -U -u 1000 hybridcloud && chown -R hybridcloud:hybridcloud /operator
USER 1000:1000
CMD ["kopf", "run", "--liveness=http://0.0.0.0:8080/healthz", "main.py", "-A"]