<commit_before>## [container-id]
## Build image
##
## Params
##   container-id: (OPTIONAL) Container ID (see 'docker ps -a').

local container_id="$1"

if docker images | grep $DOCKDEV_IMAGE > $DEV_NULL
	then
		e "Deleting image $(style bold)${DOCKDEV_IMAGE}$(style normal)..."
		! docker rmi $DOCKDEV_IMAGE && error "Error deleting image $(style bold)${DOCKDEV_IMAGE}$(style normal)!"
	fi

if [ -z "$container_id" ]; then
    e "Building $(style bold)${DOCKDEV_IMAGE}$(style normal) from $(style bold)Dockerfile$(style normal)..."
    docker build -t $DOCKDEV_IMAGE ${SOURCES_PATH}
else
	_rmi $container_id
    e "Building $(style bold)${DOCKDEV_IMAGE}$(style normal) from Container ID $(style bold)${container_id}$(style normal)..."
    echo docker commit $container_id $DOCKDEV_IMAGE
fi
<commit_msg>Fix build: rm image check<commit_after>## [container-id]
## Build image
##
## Params
##   container-id: (OPTIONAL) Container ID (see 'docker ps -a').

local container_id="$1"

if docker images | egrep "^${DOCKDEV_IMAGE}\s" > $DEV_NULL
	then
		e "Deleting image $(style bold)${DOCKDEV_IMAGE}$(style normal)..."
		! docker rmi $DOCKDEV_IMAGE && error "Error deleting image $(style bold)${DOCKDEV_IMAGE}$(style normal)!"
	fi

if [ -z "$container_id" ]; then
    e "Building $(style bold)${DOCKDEV_IMAGE}$(style normal) from $(style bold)Dockerfile$(style normal)..."
    docker build -t $DOCKDEV_IMAGE ${SOURCES_PATH}
else
	_rmi $container_id
    e "Building $(style bold)${DOCKDEV_IMAGE}$(style normal) from Container ID $(style bold)${container_id}$(style normal)..."
    echo docker commit $container_id $DOCKDEV_IMAGE
fi

{'fraction_non_alphanumeric': 0.1545566502463054, 'fraction_numerical': 0.0012315270935960591, 'mean_word_length': 5.109022556390977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '74082', 'n_tokens_mistral': 569, 'n_tokens_neox': 544, 'n_words': 158}