Skip to content

Commit

Permalink
Merge branch 'release/1.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandGouny committed Mar 13, 2021
2 parents 87349ba + 64faa55 commit 8200d17
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 18 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

# [1.3.3] - Unreleased
### Changed
- Multiple log line message are now split and log line by line for a nicest display.

### Fixed
- log-level broken pipe

# [1.3.2] - 2021-02-18
### Fixed
- Remove -x bash flag on log-helper tool
Expand Down Expand Up @@ -172,6 +179,7 @@
## 0.1.0 - 2015-07-23
Initial release

[1.3.3]: https://github.com/osixia/docker-light-baseimage/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/osixia/docker-light-baseimage/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/osixia/docker-light-baseimage/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/osixia/docker-light-baseimage/compare/v1.2.0...v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = osixia/light-baseimage
VERSION = 1.3.2
VERSION = 1.3.3

.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

[hub]: https://hub.docker.com/r/osixia/light-baseimage/

Latest release: 1.3.2 [Changelog](CHANGELOG.md)
Latest release: 1.3.3 [Changelog](CHANGELOG.md)
| [Docker Hub](https://hub.docker.com/r/osixia/light-baseimage/) 

A **Debian 10 (Buster)** based docker image to build reliable image quickly. This image provide a simple opinionated solution to build multiple or single process image with minimum of layers and an optimized build.
Expand Down Expand Up @@ -150,7 +150,7 @@ In the Dockerfile we are going to:

# Use osixia/light-baseimage
# https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:1.3.2
FROM osixia/light-baseimage:1.3.3

# Download nginx from apt-get and clean apt-get files
RUN apt-get -y update \
Expand Down Expand Up @@ -392,7 +392,7 @@ In the Dockerfile we are going to:

# Use osixia/light-baseimage
# https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:1.3.2
FROM osixia/light-baseimage:1.3.3

# Install multiple process stack, nginx and php7.0-fpm and clean apt-get files
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-multiple-process-stack
Expand Down Expand Up @@ -593,7 +593,7 @@ Here simple Dockerfile example how to add a service-available to an image:

# Use osixia/light-baseimage
# https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:1.3.2
FROM osixia/light-baseimage:1.3.3

# Add cfssl and cron service-available
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
Expand Down Expand Up @@ -662,7 +662,7 @@ What it does:

*Run tool* takes several options, to list them:

docker run osixia/light-baseimage:1.3.2 --help
docker run osixia/light-baseimage:1.3.3 --help
usage: run [-h] [-e] [-s] [-p] [-f] [-o {startup,process,finish}]
[-c COMMAND [WHEN={startup,process,finish} ...]] [-k]
[--wait-state FILENAME] [--wait-first-startup] [--keep-startup-env]
Expand Down Expand Up @@ -773,7 +773,7 @@ If a main command is set for example:
If a main command is set *run tool* launch it otherwise bash is launched.
Example:

docker run -it osixia/light-baseimage:1.3.2
docker run -it osixia/light-baseimage:1.3.3


##### Extra environment variables
Expand Down Expand Up @@ -849,8 +849,8 @@ Note this yaml definition:

Can also be set by command line converted in python or json:

docker run -it --env FRUITS="#PYTHON2BASH:['orange','apple']" osixia/light-baseimage:1.3.2 printenv
docker run -it --env FRUITS="#JSON2BASH:[\"orange\",\"apple\"]" osixia/light-baseimage:1.3.2 printenv
docker run -it --env FRUITS="#PYTHON2BASH:['orange','apple']" osixia/light-baseimage:1.3.3 printenv
docker run -it --env FRUITS="#JSON2BASH:[\"orange\",\"apple\"]" osixia/light-baseimage:1.3.3 printenv

### Tests

Expand Down
2 changes: 1 addition & 1 deletion example/multiple-process-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use osixia/light-baseimage
# https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:1.3.2
FROM osixia/light-baseimage:1.3.3

# Install multiple process stack, nginx and php7.0-fpm and clean apt-get files
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-multiple-process-stack
Expand Down
2 changes: 1 addition & 1 deletion example/single-process-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use osixia/light-baseimage
# https://github.com/osixia/docker-light-baseimage
FROM osixia/light-baseimage:1.3.2
FROM osixia/light-baseimage:1.3.3

# Download nginx from apt-get and clean apt-get files
RUN apt-get -y update \
Expand Down
32 changes: 26 additions & 6 deletions image/tool/log-helper
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,60 @@ function print_log(){
local level_txt=$1
local message=$2
local date=$(date +"%Y-%m-%d %T")
echo "*** ${level_txt} | ${date} | ${message}"

readarray -t messages <<<"$message"

for m in "${messages[@]}"; do
echo "*** ${level_txt} | ${date} | ${m}"
done
}

function error() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 1 ]; then
getEchoParams $@
echo $echo_param "$(print_log " ERROR " "$echo_msg")"
fi
}

function warning() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 2 ]; then
getEchoParams $@
echo $echo_param "$(print_log "WARNING" "$echo_msg")"
fi
}

function info() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 3 ]; then
getEchoParams $@
echo $echo_param "$(print_log " INFO " "$echo_msg")"
fi
}

function debug() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 4 ]; then
getEchoParams $@
echo $echo_param "$(print_log " DEBUG " "$echo_msg")"
fi
}

function trace() {

# getEchoParams no matter what level it is to not break pipes
getEchoParams $@

if [ $log_level -ge 5 ]; then
getEchoParams $@
echo $echo_param "$(print_log " TRACE " "$echo_msg")"
fi
}
Expand Down
3 changes: 2 additions & 1 deletion image/tool/run
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class AlarmException(Exception):

def write_log(level, message):
now = datetime.now()
sys.stderr.write("*** %s | %s | %s\n" % (level, now.strftime("%Y-%m-%d %H:%M:%S"), message))
for line in message.splitlines():
sys.stderr.write("*** %s | %s | %s\n" % (level, now.strftime("%Y-%m-%d %H:%M:%S"), line))

def error(message):
if log_level >= LOG_LEVEL_ERROR:
Expand Down

0 comments on commit 8200d17

Please sign in to comment.