Skip to content

Commit

Permalink
Feat/start using docker entrypoint script (#27)
Browse files Browse the repository at this point in the history
* Feat/start-using-docker-entrypoint-script

according to https://github.com/docker-library/official-images\#consistency

* bump version & add changelog entry
  • Loading branch information
KarstenSiemer authored Jun 29, 2020
1 parent 0bdc13c commit 2724b32
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com),
and this project adheres to [Semantic Versioning](https://semver.org).

## [2.1.2] - 2020-06-25
### Added
- Added entrypoint script to meet requirements of official docker image consistency

## [2.1.1] - 2020-06-23
### Fixed
- Fixed setting the labels twice when releasing 2.1.0
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ USER root
RUN apt-get update && apt-get install -y --no-install-recommends python3 python-pip python-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/*

COPY --from=builder /rep /rep
COPY docker-entrypoint.sh /docker-entrypoint.sh
WORKDIR /rep
RUN pip3 install --no-index --find-links=/rep/wheels .
ENTRYPOINT ["gordian"]
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["gordian"]
15 changes: 15 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
set -e

# this if will check if the first argument is a flag
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
set -- gordian "$@"
fi

# check for the expected command
if [ "$1" = 'gordian' ]; then
exec gordian "$@"
fi

# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup_reqs = ['pytest', 'pytest-cov', 'pytest-runner', 'flake8']
setuptools.setup(
name="gordian",
version="2.1.1",
version="2.1.2",
author="Intuit",
author_email="[email protected]",
description="A tool to search and replace files in a Git repo",
Expand Down

0 comments on commit 2724b32

Please sign in to comment.