Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e56faad

Browse files
committed
collect cores inside containers
1 parent 14941de commit e56faad

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ RUN apt-get update && apt-get install -y \
1818
libreadline-dev \
1919
bison \
2020
flex \
21-
zlib1g-dev \
21+
zlib1g-dev \
22+
sudo \
2223
&& rm -rf /var/lib/apt/lists/*
2324

2425
RUN mkdir /pg && chown postgres:postgres /pg
26+
# We need that to allow editing of /proc/sys/kernel/core_pattern
27+
# from docker-entrypoint.sh
28+
RUN echo "postgres ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
29+
2530
USER postgres
2631
ENV CFLAGS -O0
2732
WORKDIR /pg
@@ -34,7 +39,7 @@ RUN cd /pg && \
3439

3540
ENV PATH /pg/install/bin:$PATH
3641
ENV PGDATA /pg/data
37-
RUN mkdir PGDATA
42+
3843

3944
# Here we can insert some ENV var to invalidate subsequent layers
4045

tests2/docker-entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if [ "${1:0:1}" = '-' ]; then
66
set -- postgres "$@"
77
fi
88

9+
sudo sh -c 'echo "/pg/%p.%s.%c.%P.core" > /proc/sys/kernel/core_pattern'
10+
911
if [ "$1" = 'postgres' ]; then
1012
mkdir -p "$PGDATA"
1113
chmod 700 "$PGDATA"

0 commit comments

Comments
 (0)