Skip to content

Commit

Permalink
Release 0.0.1 main docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
vyahello committed Aug 13, 2020
1 parent 1ee5cd4 commit f8e92fc
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Versions
========

0.0.2
========

_Release date: 13.08.2020_

- Release 0.0.1 main docker image

0.0.1
========

Expand Down
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM vyahello/pep8-checker-base:0.0.1
LABEL version=0.0.1 \
metadata="The main image for pep8-checker application" \
maintainer="Volodymyr Yahello <vyahello@gmail.com>"
ARG VERSION
ARG REPOSITORY
ARG AWS_ENDPOINT
ENV CODE_DIR="/code" \
IMAGE_VERSION=${VERSION} \
IMAGE_REPO=${REPOSITORY} \
AWS_ENDPOINT=${AWS_ENDPOINT}
WORKDIR ${CODE_DIR}
COPY checker checker
COPY requirements.txt docker-entry.sh ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
rm -v requirements.txt
ENTRYPOINT ["/code/docker-entry.sh"]
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ _**Note**: please make sure **AWS_ENDPOINT** environment variable is configured
#### Base image
Please use the following command sample to build base docker image:
```bash
docker build --no-cache -t vyahello/pep8-checker:{version} -f Dockerfile.base .
docker build --no-cache \
-t vyahello/pep8-checker:{version} \
-f Dockerfile.base .
```

#### Main image
Please use the following command sample to build main docker image:
```bash
docker build --no-cache -t vyahello/pep8-checker \
--build-arg VERSION={version} \
--build-arg REPOSITORY=vyahello/pep8-checker \
--build-arg AWS_ENDPOINT={endpoint} .
docker build --no-cache \
-t vyahello/pep8-checker:{version} \
--build-arg VERSION={version} \
--build-arg REPOSITORY=vyahello/pep8-checker \
--build-arg AWS_ENDPOINT={endpoint} .
```

### Testing
Expand Down
2 changes: 1 addition & 1 deletion checker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
__email__: str = 'vyahello@gmail.com'
__license__: str = 'MIT'
__copyright__: str = f'Copyright 2020, {__author__}'
__version__: str = '0.0.0'
__version__: str = '0.0.2'
45 changes: 45 additions & 0 deletions docker-entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash


helper() {
:<<DOC
Shows 'help' message
DOC
cat <<HELP
This program allows to launch pep8-checker application via docker image.
Please use next command:
- 'help' to see tool help
docker run ${IMAGE_REPO}:${IMAGE_VERSION} --help
- 'quotes' to run quotes web application
docker run -it -p {local-port}:5050 ${IMAGE_REPO}:${IMAGE_VERSION} checker
HELP
}


checker() {
:<<DOC
Entrypoint to launch 'pep8-checker' web application
DOC
python -m checker
}


main() {
:<<DOC
Launches 'main' tools executor
DOC
if (
[[ "$1" == "-h" ]] ||
[[ "$1" == "--help" ]] ||
[[ "$1" == "help" ]] ||
[[ $# -eq 0 ]]
); then
helper
exit 0
fi
local cmd=$1; shift
eval "${cmd} $@"
}


main $@
2 changes: 1 addition & 1 deletion tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_server_reloader(server: Server) -> None:

def test_server_as_json(server: Server) -> None:
assert server.as_json() == {
'host': 'localhost', 'port': 5050, 'is_debug': True, 'reloader': True
'host': '0.0.0.0', 'port': 5050, 'is_debug': True, 'reloader': True
}


Expand Down

0 comments on commit f8e92fc

Please sign in to comment.