From 7f418dd77cfa37ed914209972ce8b11f7d09511a Mon Sep 17 00:00:00 2001 From: "avi@robusta.dev" Date: Tue, 18 Jun 2024 11:11:53 +0300 Subject: [PATCH] remove duplicated build --- Dockerfile | 62 ------------------------------------------------------ 1 file changed, 62 deletions(-) diff --git a/Dockerfile b/Dockerfile index c5efe1a25..8b64e9ef7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,68 +54,6 @@ COPY --from=builder /etc/robusta/playbooks/defaults /etc/robusta/playbooks/defau # Copy virtual environment and application files from the build stage COPY --from=builder /app /app -# Install necessary packages for the runtime environment -RUN apt-get update \ - && dpkg --add-architecture arm64 \ - && apt-get install -y --no-install-recommends git ssh curl libcairo2 \ - && pip3 install --no-cache-dir --upgrade pip \ - && rm -rf /var/lib/apt/lists/* -# Build stage -FROM python:3.11-slim as builder -ENV PATH="/root/.local/bin/:$PATH" - -RUN apt-get update \ - && dpkg --add-architecture arm64 \ - && apt-get install -y --no-install-recommends curl gcc \ - && pip3 install --no-cache-dir --upgrade pip \ - && rm -rf /var/lib/apt/lists/* - -ENV ENV_TYPE=DEV - -RUN mkdir /app -WORKDIR /app - -# Create and activate virtual environment -RUN python -m venv /app/venv --upgrade-deps && \ - . /app/venv/bin/activate - -ENV VIRTUAL_ENV=/app/venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -# Install Poetry -RUN curl -sSL https://install.python-poetry.org | python3 - -RUN poetry config virtualenvs.create false - -# Install gcc to compile ruamel.yaml.clib, wheel is missing. -RUN pip3 install --no-cache-dir ruamel.yaml.clib==0.2.8 - -# Install project dependencies -COPY pyproject.toml poetry.lock /app/ -RUN poetry install --no-root --only main --extras "all" - -# Copy project source code -COPY src/ /app/src -RUN poetry install --no-dev --extras "all" - -# Install playbooks -COPY playbooks/ /etc/robusta/playbooks/defaults -RUN pip install --no-cache-dir /etc/robusta/playbooks/defaults - -# Final stage -FROM python:3.11-slim - -ENV ENV_TYPE=DEV -ENV PYTHONUNBUFFERED=1 -ENV VIRTUAL_ENV=/app/venv -ENV PATH="/venv/bin:$PATH" -ENV PYTHONPATH=$PYTHONPATH:.:/app/src - -WORKDIR /app -COPY --from=builder /app/venv /venv -COPY --from=builder /etc/robusta/playbooks/defaults /etc/robusta/playbooks/defaults -# Copy virtual environment and application files from the build stage -COPY --from=builder /app /app - # Install necessary packages for the runtime environment RUN apt-get update \ && dpkg --add-architecture arm64 \