Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't install pgx as root or under / #421

Merged
merged 2 commits into from
May 17, 2022
Merged
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
24 changes: 12 additions & 12 deletions docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ RUN apt-get update \
&& apt-get install -y clang libclang1 sudo bash cmake \
&& rm -rf /var/lib/apt/lists/*

# install cargo pgx
RUN cargo install cargo-pgx --version '^0.2' --root /pgx/0.2 \
&& cargo install cargo-pgx --version '^0.4' --root /pgx/0.4

ENV PATH "/pgx/0.2/bin/:${PATH}"

# install doctester
RUN cargo install --git https://github.com/timescale/timescaledb-toolkit.git --branch main sql-doctester

RUN useradd -ms /bin/bash postgres
USER postgres

# install cargo pgx
RUN cargo install cargo-pgx --version '^0.2' --root /home/postgres/pgx/0.2 \
&& cargo install cargo-pgx --version '^0.4' --root /home/postgres/pgx/0.4

ENV PATH "/home/postgres/pgx/0.2/bin/:${PATH}"

RUN set -ex \
&& cargo pgx init --pg12 download --pg13 download --pg14 download \
&& cargo pgx start pg12 \
Expand All @@ -34,28 +31,31 @@ RUN set -ex \
&& cd timescaledb \
&& git checkout 2.5.x \
&& cd ~/timescaledb \
&& ./bootstrap -DPG_CONFIG=~/.pgx/12.10/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
&& ./bootstrap -DPG_CONFIG=~/.pgx/12.11/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was wondering how long it'd be until something broke after the minor versions were all bumped :)

&& cd build \
&& make -j4 \
&& make -j4 install \
&& echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgx/data-12/postgresql.conf \
&& cd .. \
&& rm -rf ./build \
&& ./bootstrap -DPG_CONFIG=~/.pgx/13.6/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
&& ./bootstrap -DPG_CONFIG=~/.pgx/13.7/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
&& cd build \
&& make -j4 \
&& make -j4 install \
&& echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgx/data-13/postgresql.conf \
&& cd .. \
&& rm -rf ./build \
&& ./bootstrap -DPG_CONFIG=~/.pgx/14.2/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
&& ./bootstrap -DPG_CONFIG=~/.pgx/14.3/pgx-install/bin/pg_config -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DUSE_OPENSSL=false -DSEND_TELEMETRY_DEFAULT=false -DREGRESS_CHECKS=false \
&& cd build \
&& make -j4 \
&& make -j4 install \
&& echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgx/data-14/postgresql.conf \
&& cd ~ \
&& rm -rf ~/timescaledb

# install doctester
RUN cargo install --git https://github.com/timescale/timescaledb-toolkit.git --branch main sql-doctester

# add clippy
RUN rustup component add clippy

Expand Down