Skip to content

Commit c86f727

Browse files
committed
Added support for launching psql tools from Docker
1 parent 967738a commit c86f727

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Diff for: Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu
2+
RUN apt-get update && \
3+
apt-get upgrade -y && \
4+
apt-get install git build-essential libreadline-dev zlib1g-dev bison flex -y && \
5+
git clone https://github.com/mkopec3/postgres-pth.git /usr/local/src/postgres-pth && \
6+
cd /usr/local/src/postgres-pth/ && \
7+
./configure --prefix=/ && \
8+
make -j`nproc` -C src/interfaces/ install && \
9+
make -j`nproc` -C src/bin/ install && \
10+
cd && rm -rf /usr/local/src/postgres-pth/ && \
11+
apt-get remove --purge git build-essential zlib1g-dev bison flex -y && \
12+
apt-get autoremove -y && \
13+
apt-get clean
14+
ENTRYPOINT [ "psql" ]
15+
CMD ["--version"]

Diff for: README.md

+12
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Pass-The-Hash enabled PostgreSQL client software on recent versions of Linux & W
2121
* Microsoft SDK 8.1
2222
* [PostgreSQL build dependencies](https://www.postgresql.org/docs/9.0/install-windows-full.html#AEN24042)
2323

24+
**Docker**
25+
* Docker :)
2426

2527
### Installing
2628

@@ -42,6 +44,9 @@ From VS2017 Developer Command Prompt:
4244

4345
Copy \Release\libpq\libpq.dll, \Release\psqlpsql.exe, and vcruntime140.dll (you need to find it) files to the same selected directory
4446

47+
**Docker**
48+
Refer to Usage section
49+
4550

4651
### Usage
4752

@@ -59,6 +64,13 @@ $ psql.exe -h 127.0.0.1 -p 5432 -U username dbname
5964
Hash for user username: md57bf07133****************1c058d18
6065
```
6166

67+
**Docker**
68+
69+
```
70+
$ docker run -it mkopec3/postgres-pth -h X.X.X.X -p 5432 -U username dbname
71+
Hash for user username: md57bf07133****************1c058d18
72+
```
73+
6274

6375
## Issues
6476

0 commit comments

Comments
 (0)