Skip to content

Commit

Permalink
Update Docierfile and entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
madharjan committed May 19, 2019
1 parent fb95d55 commit afd65b4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 9.5

### Changes

* Based on [gliderlabs/alpine](https://github.com/gliderlabs/docker-alpine/)
* Using PostgreSQL Client 9.5.13

13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ ARG VCS_REF
ARG POSTGRESQL_VERSION
ARG DEBUG=false

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

ENV HOME /root
ENV ALPINE_VERSION 3.4
ENV POSTGRESQL_VERSION ${POSTGRESQL_VERSION}

COPY ./psql.sh /
RUN mkdir -p /build
COPY . /build

RUN apk update && \
apk add bash postgresql-client && \
rm -rf /var/cache/apk/* \
rm -rf /tmp/* && \
chmod 755 /psql.sh
RUN chmod 755 /build/scripts/*.sh && /build/scripts/install.sh && /build/scripts/cleanup.sh

WORKDIR /root

ENTRYPOINT ["/psql.sh"]
ENTRYPOINT ["/docker-entrypoint.sh"]
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ stop:

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

publish: docker_login run test clean
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.com/madharjan/docker-postgresql-client.svg?branch=master)](https://travis-ci.com/madharjan/docker-postgresql-client)
[![Layers](https://images.microbadger.com/badges/image/madharjan/docker-postgresql-client.svg)](http://microbadger.com/images/madharjan/docker-postgresql-client)

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

## Features

Expand Down
10 changes: 10 additions & 0 deletions scripts/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
set -e

if [ "${DEBUG}" = true ]; then
set -x
fi

rm -rf /var/cache/apk/*
rm -rf /tmp/*
rm -rf /build
File renamed without changes.
13 changes: 13 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

if [ "${DEBUG}" = true ]; then
set -x
fi

apk update
apk add bash
apk add postgresql-client

cp /build/scripts/docker-entrypoint.sh /
chmod 755 /docker-entrypoint.sh

0 comments on commit afd65b4

Please sign in to comment.