Skip to content

Commit

Permalink
chore: use debian base images instead of alpine (#285)
Browse files Browse the repository at this point in the history
* chore: use debian base images instead of alpine

* fix test_env makefile stuff

* fix mutation
  • Loading branch information
matt-codecov authored Apr 15, 2024
1 parent f15348a commit b141050
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 24 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ test_env.install_cli:
pip install --no-cache-dir codecov-cli==$(CODECOV_CLI_VERSION)

test_env.container_prepare:
apk add -U curl git build-base jq
apt-get install -y git build-essential netcat-traditional
make test_env.install_cli
git config --global --add safe.directory /worker

Expand Down Expand Up @@ -252,7 +252,7 @@ test_env.run_mutation:
docker-compose exec worker make test_env.container_mutation

test_env.container_mutation:
apk add git
apt-get install -y git
git diff origin/main ${full_sha} > data.patch
pip install mutmut[patch]
mutmut run --use-patch-file data.patch || true
Expand All @@ -264,4 +264,4 @@ test_env:
make test_env.prepare
make test_env.check_db
make test_env.run_unit
make test_env.run_integration
make test_env.run_integration
44 changes: 24 additions & 20 deletions docker/Dockerfile.requirements
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# syntax=docker/dockerfile:1.4
ARG PYTHON_IMAGE=python:3.10.13-alpine3.18
ARG PYTHON_IMAGE=python:3.10.13-slim-bookworm

# BUILD STAGE
FROM $PYTHON_IMAGE as build

RUN apk add --upgrade --no-cache apk-tools && \
apk add --update --no-cache \
git \
openssh \
postgresql-dev \
musl-dev \
libxslt-dev \
python3-dev \
# Pinning a specific nightly version so that builds don't suddenly break if a
# "this feature is now stabilized" warning is promoted to an error or something.
# We would like to keep up with nightly if we can.
ARG RUST_VERSION=nightly-2023-02-22
ENV RUST_VERSION=${RUST_VERSION}

RUN apt-get update
RUN apt-get install -y \
build-essential \
libffi-dev \
gcc \
libcurl \
build-base \
curl-dev \
rust \
cargo \
&& pip install --upgrade pip
libpq-dev \
curl

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| bash -s -- -y --default-toolchain $RUST_VERSION
ENV PATH="/root/.cargo/bin:$PATH"

COPY requirements.txt /
WORKDIR /pip-packages/
Expand All @@ -27,16 +29,18 @@ ENV PYCURL_SSL_LIBRARY=openssl
RUN pip wheel --no-cache-dir -r /requirements.txt
RUN rm -rf /pip-packages/src


# RUNTIME STAGE - Copy packages from build stage and install runtime dependencies
FROM $PYTHON_IMAGE

RUN apk add --upgrade --no-cache apk-tools busybox expat libretls postgresql-libs gcc libxslt-dev curl make
RUN apt-get update
RUN apt-get install -y \
libpq-dev \
make

WORKDIR /pip-packages/
COPY --from=build /pip-packages/ /pip-packages/


RUN pip install --no-deps --no-index --find-links=/pip-packages/ /pip-packages/*

RUN addgroup -S application && adduser -S codecov -G application
RUN addgroup --system application \
&& adduser --system codecov --ingroup application --home /home/codecov
2 changes: 1 addition & 1 deletion worker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

if [ -n "$PROMETHEUS_MULTIPROC_DIR" ]; then
rm -r "$PROMETHEUS_MULTIPROC_DIR" 2> /dev/null
Expand Down

0 comments on commit b141050

Please sign in to comment.