The explode_version command (or the script) explodes a given version info in to JSON object string.
Useful to get version info into tokens for versioning. Mostly aimed to use for DockerHub's tag list.
For example, the string "php:7.3.4-cli-alpine3.9" becomes as below:
{
"php": {
"name": "php",
"version": "7.3.4"
},
"cli": {
"name": "cli"
},
"alpine": {
"name": "alpine",
"version": "3.9"
}
}
Requirements: PHP >= 5.6.40 (PHP versions tested)
Source Code:
chmod +x the downloaded script.Sample Usage:
$ # With --pretty option
$ ./explode_version --pretty 'php 7.3.4-cli-alpine3.9'
{
"php": {
"name": "php",
"version": "7.3.4"
},
"cli": {
"name": "cli"
},
"alpine": {
"name": "alpine",
"version": "3.9"
}
}
$
$ # With no option
$ ./explode_version php7.0.1-cli-alpine3.0
{"php":{"name":"php","version":"7.0.1"},"cli":{"name":"cli"},"alpine":{"name":"alpine","version":"3.0"}}
Docker Image: keinos/explode_version @ Docker Hub
Repositories:
Sample usage:
$ # With --pretty option
$ docker run --rm keinos/explode_version --pretty "php:7.3.4-cli-alpine3.9"
{
"php": {
"name": "php",
"version": "7.3.4"
},
"cli": {
"name": "cli"
},
"alpine": {
"name": "alpine",
"version": "3.9"
}
}
$
$ # With no option
$ docker run --rm keinos/explode_version php7.0.1-cli-alpine3.0
{"php":{"name":"php","version":"7.0.1"},"cli":{"name":"cli"},"alpine":{"name":"alpine","version":"3.0"}}
See: README_DOCKER.md for more
$ ./explode_version --help
Usage: explode_version [OPTION] VERSION
OPTION:
-h, --help This help.
--pretty Outputs with indentation.
VERSION: A string to be alanlized.
Content type
Image
Digest
Size
6 MB
Last updated
over 7 years ago
docker pull keinos/explode_version