Skip to content

Commit 37e037b

Browse files
author
Alexey Matveev
committed
Dockerfile
1 parent 7791128 commit 37e037b

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

Dockerfile

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
FROM postgres:9.6
2-
MAINTAINER Olivier El Mekki <olivier@el-mekki.com>
1+
FROM postgres:10.6
2+
MAINTAINER Matveev Alexey
33

4-
RUN apt-get update && apt-get install -y build-essential curl postgresql-server-dev-9.6
5-
RUN curl https://ftp.postgresql.org/pub/source/v9.6.0/postgresql-9.6.0.tar.bz2 -o /postgresql-9.6.0.tar.bz2
6-
RUN cd / && tar xvf postgresql-9.6.0.tar.bz2
7-
RUN cd /postgresql-9.6.0/contrib/cube && sed -i 's/#define CUBE_MAX_DIM (100)/#define CUBE_MAX_DIM (350)/' cubedata.h && \
8-
USE_PGXS=true make && USE_PGXS=true make install
4+
ARG A_DIMENSHION=128
5+
6+
# ===/ Dimenshion cube
7+
RUN apt-get update && \
8+
apt-get install -y build-essential curl postgresql-server-dev-10 && \
9+
curl https://ftp.postgresql.org/pub/source/v10.6/postgresql-10.6.tar.bz2 -o /postgresql-10.6.tar.bz2 && \
10+
tar xvf /postgresql-10.6.tar.bz2 && \
11+
cd /postgresql-10.6/contrib/cube && \
12+
sed -i "s/#define CUBE_MAX_DIM (100)/#define CUBE_MAX_DIM (${A_DIMENSHION}/" cubedata.h && \
13+
USE_PGXS=true make && \
14+
USE_PGXS=true make install && \
15+
rm -rf /postgresql-10.6 && \
16+
apt-get remove -y build-essential curl postgresql-server-dev-10 && \
17+
apt-get -y autoremove && \
18+
rm -rf /var/lib/apt/lists/*
19+
20+
EXPOSE 5432

README.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pg350d
22

3-
Docker build of postgresql-9.6 changing the dimension limit for the cube extension, raising it to 350.
3+
Docker build of postgresql-10.6 changing the dimension limit for the cube extension, raising it to 128.
44

55
This is needed to be able to work with words embedding with postgres.
66

@@ -26,27 +26,22 @@ your backups (and not upgrade postgres if you usually do so through dump/import)
2626

2727
## Download
2828

29-
The image dockerhub page is [here](https://hub.docker.com/r/oelmekki/pg350d/).
29+
The image dockerhub page is [here](https://cloud.docker.com/repository/docker/shizacat/pg350d).
3030

3131
To pull it:
3232

3333
```
34-
docker pull oelmekki/pg350d:9.6
34+
docker pull shizacat/pg350d:10.6
3535
```
3636

3737

3838
## Is it safe?
3939

40-
Patching the hardcoded limit is [the recommended way in postgres doc](https://www.postgresql.org/docs/9.5/static/cube.html#AEN169535).
40+
Patching the hardcoded limit is [the recommended way in postgres doc](https://www.postgresql.org/docs/10/static/cube.html#AEN169535).
4141

4242
I've been using it for several months on my main business, and didn't encounter any problem so far.
4343

4444

45-
## Variants
46-
47-
If you want more than 350d and don't want to change it yourself, [@lisitsky made a 2000d variant](https://github.com/lisitsky/postgres-2kd).
48-
49-
5045
## How to raise postgresql's cube extension dimensions limit?
5146

5247
Even if you're not familiar with docker, reading the Dockerfile from this repos

0 commit comments

Comments
 (0)