Skip to content

Commit afd65b4

Browse files
committed
Update Docierfile and entrypoint
1 parent fb95d55 commit afd65b4

File tree

8 files changed

+38
-9
lines changed

8 files changed

+38
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 9.5
2+
3+
### Changes
4+
5+
* Based on [gliderlabs/alpine](https://github.com/gliderlabs/docker-alpine/)
6+
* Using PostgreSQL Client 9.5.13
7+

Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,18 @@ ARG VCS_REF
55
ARG POSTGRESQL_VERSION
66
ARG DEBUG=false
77

8-
LABEL description="Docker container with Postgresql Client" os_version="Alpine 3.4" \
8+
LABEL description="Docker container with PostgreSQL Client" os_version="Alpine 3.4" \
99
org.label-schema.vcs-ref=${VCS_REF} org.label-schema.vcs-url="https://github.com/madharjan/docker-postgresql-client"
1010

1111
ENV HOME /root
1212
ENV ALPINE_VERSION 3.4
1313
ENV POSTGRESQL_VERSION ${POSTGRESQL_VERSION}
1414

15-
COPY ./psql.sh /
15+
RUN mkdir -p /build
16+
COPY . /build
1617

17-
RUN apk update && \
18-
apk add bash postgresql-client && \
19-
rm -rf /var/cache/apk/* \
20-
rm -rf /tmp/* && \
21-
chmod 755 /psql.sh
18+
RUN chmod 755 /build/scripts/*.sh && /build/scripts/install.sh && /build/scripts/cleanup.sh
2219

2320
WORKDIR /root
2421

25-
ENTRYPOINT ["/psql.sh"]
22+
ENTRYPOINT ["/docker-entrypoint.sh"]

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ stop:
4848

4949
clean: stop
5050
docker rm postgresql_client 2> /dev/null || true
51+
docker ps -a | grep "Exited" | awk '{print$$1}' | xargs docker rm 2> /dev/null || true
5152
docker images | grep "<none>" | awk '{print$3 }' | xargs docker rmi 2> /dev/null || true
5253

5354
publish: docker_login run test clean

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://travis-ci.com/madharjan/docker-postgresql-client.svg?branch=master)](https://travis-ci.com/madharjan/docker-postgresql-client)
44
[![Layers](https://images.microbadger.com/badges/image/madharjan/docker-postgresql-client.svg)](http://microbadger.com/images/madharjan/docker-postgresql-client)
55

6-
Docker container with PostgreSQL Client Server based on [gliderlabs/alpine](https://github.com/gliderlabs/docker-alpine/)
6+
Docker container with PostgreSQL Client based on [gliderlabs/alpine](https://github.com/gliderlabs/docker-alpine/)
77

88
## Features
99

scripts/cleanup.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ "${DEBUG}" = true ]; then
5+
set -x
6+
fi
7+
8+
rm -rf /var/cache/apk/*
9+
rm -rf /tmp/*
10+
rm -rf /build
File renamed without changes.

scripts/install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
set -e
3+
4+
if [ "${DEBUG}" = true ]; then
5+
set -x
6+
fi
7+
8+
apk update
9+
apk add bash
10+
apk add postgresql-client
11+
12+
cp /build/scripts/docker-entrypoint.sh /
13+
chmod 755 /docker-entrypoint.sh

0 commit comments

Comments
 (0)