Merge pull request #4566 from jasiek/master
Normalize Dockerfile line terminators to handle issues in port extraction
This commit is contained in:
@@ -20,6 +20,7 @@ trigger-builder-dockerfile-builder-build() {
|
|||||||
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
pushd "$SOURCECODE_WORK_DIR" &>/dev/null
|
||||||
|
|
||||||
# extract first port from Dockerfile
|
# extract first port from Dockerfile
|
||||||
|
dos2unix Dockerfile
|
||||||
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
|
local DOCKERFILE_PORTS=$(get_dockerfile_exposed_ports Dockerfile)
|
||||||
[[ -n "$DOCKERFILE_PORTS" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_PORTS="$DOCKERFILE_PORTS"
|
[[ -n "$DOCKERFILE_PORTS" ]] && config_set --no-restart "$APP" DOKKU_DOCKERFILE_PORTS="$DOCKERFILE_PORTS"
|
||||||
plugn trigger pre-build-dockerfile "$APP"
|
plugn trigger pre-build-dockerfile "$APP"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
|||||||
verify_paths() {
|
verify_paths() {
|
||||||
declare desc="verifies storage paths"
|
declare desc="verifies storage paths"
|
||||||
local -r passed_path=$1
|
local -r passed_path=$1
|
||||||
if [[ "$passed_path" = /* ]]; then
|
if [[ "$passed_path" == /* ]]; then
|
||||||
echo "$passed_path" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon."
|
echo "$passed_path" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths divided by colon."
|
||||||
else
|
else
|
||||||
echo "$passed_path" | grep -qe '^[a-zA-Z0-9]\{1\}[a-zA-Z0-9_.-]\+\:\/' || dokku_log_fail "Volume name must be two characters or more. Volume name must not contain invalid characters. Storage path must be two valid paths divided by colon."
|
echo "$passed_path" | grep -qe '^[a-zA-Z0-9]\{1\}[a-zA-Z0-9_.-]\+\:\/' || dokku_log_fail "Volume name must be two characters or more. Volume name must not contain invalid characters. Storage path must be two valid paths divided by colon."
|
||||||
|
|||||||
Reference in New Issue
Block a user