A lightweight Docker container for executing shell scripts from local files, remote URLs, or multiline strings.
The Pre-Install Toolbox is a minimal Alpine-based Docker container that provides a convenient way to run shell scripts from multiple sources:
- Local files mounted into the container
- Remote URLs (downloaded and executed)
- Multiline script strings passed as arguments
It includes essential tools like curl and wget for fetching remote scripts.
docker run nasselle/pre-install-toolbox:1.0.0 https://example.com/script.shdocker run nasselle/pre-install-toolbox:1.0.0 "
#!/bin/sh
echo 'Hello from multiline script!'
ls -la /
echo 'Script completed'
"Or with a more complex example:
docker run nasselle/pre-install-toolbox:1.0.0 "
set -e
echo 'Starting installation...'
apk update
apk add --no-cache git vim
echo 'Installation completed successfully!'
"Mount your script as /script.sh in the container:
docker run -v $(pwd)/my-script.sh:/script.sh nasselle/pre-install-toolbox:1.0.0You can pass additional arguments to any script (URL or multiline string):
# With URL
docker run nasselle/pre-install-toolbox:1.0.0 https://example.com/script.sh arg1 arg2
# With multiline string
docker run nasselle/pre-install-toolbox:1.0.0 "
echo 'First argument:' \$1
echo 'Second argument:' \$2
" arg1 arg2- If no parameters are provided, the container looks for a
/script.shfile to execute - If the first parameter starts with
http://orhttps://, it downloads and executes the script from that URL - If the first parameter doesn't start with a URL scheme, it treats it as a multiline script string and executes it directly
- Any additional parameters are passed to the script as arguments
docker build -t nasselle/pre-install-toolbox:1.0.0 .Dockerfile- Container definitionentrypoint.sh- Container entry point scriptdockflow.json- Image metadata
Warning:
- Running scripts directly from URLs can be a security risk. Always verify the source and content of scripts before execution.
- When using multiline strings, be careful with shell escaping and avoid executing untrusted input.
- Consider the security implications of any scripts you run, especially those that modify system state.
docker run nasselle/pre-install-toolbox:1.0.0 "
echo '=== System Information ==='
uname -a
echo '=== Disk Usage ==='
df -h
echo '=== Memory Usage ==='
free -h
"docker run nasselle/pre-install-toolbox:1.0.0 "
#!/bin/sh
set -e
echo 'Installing development tools...'
apk update
apk add --no-cache git curl vim bash
echo 'Development tools installed successfully!'
git --version
"MIT