Fetch and install from URLs in a minimal Docker image
4.0K
Minimal Docker image that fetches and executes shell scripts from URLs. Uses mvdan/shā , a POSIX shell interpreter written in pure Go.
Published on Docker Hub as installable/sh.
FROM installable/sh AS installable
FROM ubuntu:latest
COPY --from=installable / /
The COPY --from=installable / / pattern adds the RUN and INSTALL binaries to any base image, allowing scripts to use the base image's utilities.
| Command | Description | Status |
|---|---|---|
RUNā | Fetch and execute scripts at runtime | Ready |
INSTALLā | Installation and setup tasks during builds | WIP |
See the examplesā directory for more examples.
Fetch and execute scripts at runtime.
CMD ["RUN", "https://example.com/script.sh", "arg1", "arg2"]
Use +env to send environment variables as HTTP headers when fetching scripts:
CMD ["RUN", "+env", "https://example.com/script.sh"]
Each environment variable is sent as an X-Env-* header:
API_KEY=secret ā X-Env-API_KEY: secretFOO=bar ā X-Env-FOO: barThis allows dynamic script generation based on the container's environment.
The default User-Agent is run/1.0 (installable). Set the USER_AGENT environment variable to override it:
ENV USER_AGENT="MyApp/1.0"
CMD ["RUN", "https://example.com/script.sh"]
Use +raw to print the fetched script without executing it:
RUN +raw https://example.com/script.sh
This is useful for debugging or piping the script to another tool.
Use +nocache to request fresh content from the origin server:
RUN +nocache https://example.com/script.sh
This sets Cache-Control: no-cache, no-store, must-revalidate and Pragma: no-cache headers.
$1, $2, etc.+envUSER_AGENT env var to customize the request header+raw to print the script without executing+nocache to skip CDN cachesCOPY --from=installable / /š§ Work in Progress š§
The INSTALL command is under development and will be available in a future release. It is intended for installation and setup tasks during Docker image builds.
make # Setup, format, lint, test, and build
| Target | Description |
|---|---|
make | Run all: setup, fmt, lint, test, build |
make setup | Install git hooks and golangci-lint |
make fmt | Format code with gofmt |
make lint | Run golangci-lint |
make check | Check formatting (CI) |
make test | Run tests |
make RUN | Build RUN binary |
make INSTALL | Build INSTALL binary |
make clean | Remove binaries and test cache |
docker build -t installable/sh .
Note: The Dockerfile copies CA certificates from Alpine's ca-certificates package during the build. The certificates in internal/certs/ are placeholders for local development only.
[[, set -E, etc.)Copyright 2026 Scaffoldly LLC
Apache 2.0
Content type
Image
Digest
sha256:75aa80287ā¦
Size
3.7 MB
Last updated
3 days ago
docker pull installable/sh:sha-0237d36