2022-06-06 22:32:20 +02:00
|
|
|
# export PGB=pgbackrest;export PGB_IMAGE=$PGB/test:u22-main;PGB_REPO=~/Documents/Code/$PGB
|
2021-07-18 23:29:20 +02:00
|
|
|
# docker build --squash -f $PGB_REPO/test/Dockerfile -t $PGB_IMAGE .
|
2022-02-26 21:50:30 +02:00
|
|
|
# docker run --privileged -itd --name $PGB-test -h $PGB-test -v $PGB_REPO:/home/vagrant/$PGB $PGB_IMAGE
|
2023-01-30 07:22:41 +02:00
|
|
|
#
|
|
|
|
# When running test.pl --code-format permissions may get munged. Run this from the pgbackrest/test path to fix them:
|
|
|
|
# find .. | grep "\.[ch]$" | xargs xattr -rc && find .. | grep "\.[ch]$" | xargs chmod -x
|
2022-06-06 22:32:20 +02:00
|
|
|
FROM ubuntu:jammy
|
2021-05-03 22:31:27 +02:00
|
|
|
|
|
|
|
# Install packages
|
2021-07-18 23:29:20 +02:00
|
|
|
RUN apt-get update
|
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
|
|
|
sudo vim htop jq rsync sysstat curl \
|
2021-05-03 22:31:27 +02:00
|
|
|
libdbd-pg-perl libxml-checker-perl libyaml-perl \
|
|
|
|
devscripts build-essential lintian git cloc txt2man debhelper libssl-dev zlib1g-dev libperl-dev libxml2-dev liblz4-dev \
|
2022-06-03 20:13:56 +02:00
|
|
|
liblz4-tool libpq-dev lcov autoconf-archive zstd libzstd-dev bzip2 libbz2-dev pkg-config libyaml-dev libc6-dbg wget meson \
|
2023-05-13 18:16:16 +02:00
|
|
|
ccache valgrind tzdata uncrustify libssh2-1-dev
|
2021-05-03 22:31:27 +02:00
|
|
|
|
|
|
|
# Install Docker
|
2021-07-18 23:29:20 +02:00
|
|
|
RUN groupadd -g5000 docker
|
|
|
|
RUN curl -fsSL https://get.docker.com | sh
|
2021-05-03 22:31:27 +02:00
|
|
|
|
2022-02-26 21:50:30 +02:00
|
|
|
# Create vagrant user
|
|
|
|
RUN adduser --ingroup=docker -uid=5000 --disabled-password --gecos \"\" vagrant
|
2021-05-03 22:31:27 +02:00
|
|
|
|
2022-07-22 01:27:58 +02:00
|
|
|
# Mark git path as safe
|
|
|
|
RUN sudo -u vagrant git config --global --add safe.directory /home/vagrant/pgbackrest
|
|
|
|
|
2021-05-03 22:31:27 +02:00
|
|
|
# Configure sudo
|
2021-07-18 23:29:20 +02:00
|
|
|
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
2021-05-03 22:31:27 +02:00
|
|
|
|
2022-02-26 21:50:30 +02:00
|
|
|
# Mount tmpfs at /home/vagrant/test for faster testing
|
|
|
|
RUN sudo -u vagrant mkdir -m 770 /home/vagrant/test
|
|
|
|
RUN echo 'tmpfs /home/vagrant/test tmpfs size=4096M 0 1' >> /etc/fstab
|
2021-07-18 23:29:20 +02:00
|
|
|
|
2022-02-26 21:50:30 +02:00
|
|
|
USER vagrant
|
|
|
|
WORKDIR /home/vagrant
|
2021-05-03 22:31:27 +02:00
|
|
|
|
|
|
|
ENTRYPOINT sudo rm -f /var/run/docker.pid && sudo mount -a && sudo dockerd
|