hasura / hasura/postgres-docker
Removing libc++ in Dockerfile breaks PLV8
- Dominant language
- Dockerfile
- Stars
- 3
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
See: https://github.com/plv8/plv8/issues/302
Removing the dependencies related to `libc++` after install results in an error when trying to `CREATE EXTENSION plv8`:

If the `Dockerfile` is edited to:
```dockerfile
RUN PLV8_DEPENDENCIES="wget git g++ python pkg-config libc++-dev libc++abi-dev \
make postgresql-server-dev-$PG_MAJOR" \
&& apt-get update \
# Ideally, libtinfo5 should have been part of 'PLV8_DEPENDENCIES'
# but some versions of the debian have it installed as an essential
# package (buster, postgres 12, for example does not), which means
# that there would be an error at 'apt-get remove -y ${PLV8_DEPENDENCIES}'
&& apt-get install -y libtinfo5 ${PLV8_DEPENDENCIES} \
&& cd /root \
&& wget "https://github.com/plv8/plv8/archive/v$PLV8_VERSION.tar.gz" \
&& tar -xf "v$PLV8_VERSION.tar.gz" \
&& cd "plv8-$PLV8_VERSION" && make && make install && cd /root
```
Then all is well, however some of these are for certain not required. If I had to guess, it would be `python`, `git`, `wget`, `pkg-config`, and `make`, but I'm not entirely certain.
Maybe this would work?
```dockerfile
RUN PLV8_DEPENDENCIES="g++ libc++-dev libc++abi-dev \
postgresql-server-dev-$PG_MAJOR" \
PLV8_COMPILE_DEPENDENCIES="wget git python pkg-config make" \
&& apt-get update \
# Ideally, libtinfo5 should have been part of 'PLV8_DEPENDENCIES'
# but some versions of the debian have it installed as an essential
# package (buster, postgres 12, for example does not), which means
# that there would be an error at 'apt-get remove -y ${PLV8_DEPENDENCIES}'
&& apt-get install -y libtinfo5 ${PLV8_COMPILE_ DEPENDENCIES} ${PLV8_DEPENDENCIES} \
&& cd /root \
&& wget "https://github.com/plv8/plv8/archive/v$PLV8_VERSION.tar.gz" \
&& tar -xf "v$PLV8_VERSION.tar.gz" \
&& cd "plv8-$PLV8_VERSION" && make && make install && cd /root \
&& rm -rf "/root/v$PLV8_VERSION.tar.gz" "/root/plv8-$PLV8_VERSION" \
/root/.gsutil/ /root/.vpython_cipd_cache /root/.vpython-root \
&& apt-get remove --autoremove -y ${PLV8_COMPILE_DEPENDENCIES} \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.