Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ a ready-to-use environment directly:
Once the codespace is ready, all dependencies will be installed and hooks
will be configured automatically.

Note that the dev container is built from the project's `Dockerfile`, which
compiles `elfutils` from source, so the first build takes a few minutes.
Note that the dev container is built from the project's `Dockerfile`, which
uses the distribution-provided `libdw` and `libelf` development packages.

pystack requires elevated ptrace permissions to inspect processes — the dev
container already handles this via `--cap-add=SYS_PTRACE` and
Expand Down
46 changes: 4 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,4 @@
# Stage 1: Elfutils build stage
FROM ubuntu:26.04 AS elfutils_builder
ARG DEBIAN_FRONTEND=noninteractive
ENV VERS=0.193

# Install elfutils build dependencies
RUN apt-get update \
&& apt-get install -y --force-yes --no-install-recommends software-properties-common gpg-agent \
build-essential \
libzstd-dev \
ca-certificates \
curl \
lsb-release \
bzip2 \
zlib1g-dev \
zlib1g-dev:native \
libbz2-dev \
liblzma-dev \
gettext \
po-debconf \
gawk \
libc6-dbg \
flex \
bison \
pkg-config \
libarchive-dev \
libcurl4-gnutls-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /elfutils \
&& cd /elfutils \
&& curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2 \
&& tar -xf elfutils.tar.bz2 --strip-components 1 \
&& CFLAGS='-Wno-error -g -O3' CXXFLAGS='-Wno-error -g -O3' ./configure --disable-nls --enable-libdebuginfod=dummy --disable-debuginfod --with-zstd \
&& make install

# Stage 2: Final stage
# Build stage
FROM ubuntu:26.04
ARG DEBIAN_FRONTEND=noninteractive
LABEL org.opencontainers.image.source="https://github.com/bloomberg/pystack"
Expand Down Expand Up @@ -79,19 +43,17 @@ RUN apt-get update \
liblzma-dev \
libbz2-dev \
zlib1g-dev \
libdw-dev \
libelf-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /etc/debuginfod/*.urls

# Copy the installed files from the elfutils_builder stage
COPY --from=elfutils_builder /usr/local /usr/local

# Set environment variables
ENV PYTHON=python3.12 \
VIRTUAL_ENV="/venv" \
PATH="/venv/bin:$PATH" \
PYTHONDONTWRITEBYTECODE=1 \
TZ=UTC \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
TZ=UTC

# Copy the required files
COPY pyproject.toml /tmp/
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ skip = "*-musllinux_aarch64"
before-all = [
"yum install -y libzstd-devel cmake",
"cd /",
"VERS=0.193",
"VERS=0.195",
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
"tar -xf elfutils.tar.bz2",
"cd elfutils-$VERS",
Expand All @@ -143,7 +143,7 @@ before-all = [
# https://git.alpinelinux.org/aports/tree/main/elfutils/musl-macros.patch
"cd /",
"apk add --update argp-standalone bison bsd-compat-headers bzip2-dev flex-dev libtool linux-headers musl-fts-dev musl-libintl musl-obstack-dev xz-dev zlib-dev zstd-dev cmake",
"VERS=0.193",
"VERS=0.195",
"curl https://sourceware.org/elfutils/ftp/$VERS/elfutils-$VERS.tar.bz2 > ./elfutils.tar.bz2",
"tar -xf elfutils.tar.bz2",
"cd elfutils-$VERS",
Expand Down
Loading