swift
Swift Overview
Secure your stack with a hardened Swift image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
Use the Swift container image to compile, run, and package applications written in the Swift programming language without installing the toolchain on your local machine. This image includes the Swift compiler, Swift Package Manager, and REPL, so developers can build and test Swift code in a consistent, disposable environment instead of managing toolchain versions on the host.
Try It Out
For a quick test, print the version information:
docker run --rm \
reg.mini.dev/swift \
swift --versionRun a simple Swift script directly, without a separate compile step:
docker run --rm \
reg.mini.dev/swift \
sh -c 'echo "print(\"Hello from Swift!\")" > hello.swift && swift hello.swift'You should get a response similar to this:
Hello from Swift!Create and run a new Swift Package Manager project:
docker run --rm \
reg.mini.dev/swift \
sh -c 'mkdir HelloMinimus && cd HelloMinimus && swift package init --type executable --name HelloMinimus && swift run'Ready to work on your own Swift project?
You can mount your source code and build it inside the container. Navigate to your Swift project directory and run:
docker run -it --rm \
-v $(pwd):/usr/src/app \
-w /usr/src/app \
reg.mini.dev/swift \
swift buildFor interactive development:
docker run -it --rm \
-v $(pwd):/usr/src/app \
-w /usr/src/app \
reg.mini.dev/swift \
shTechnical Considerations
The Swift image provided by Minimus is a slim, security-hardened alternative to the public image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.
Swift built by Minimus:
- Runs as root to support required functions in alignment with the public image.
- Includes the complete toolchain: the
swiftcompiler driver, Swift Package Manager, and the interactive REPL. - Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.